From f73aaa844f760e171a68e21d7796a62e7ae51c20 Mon Sep 17 00:00:00 2001 From: Alen Mujezinovic Date: Tue, 28 Feb 2012 10:48:29 +0000 Subject: [PATCH] Syntax error fix --- httpie/httpie.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/httpie/httpie.py b/httpie/httpie.py index 1c8a5aa9..49c35aab 100755 --- a/httpie/httpie.py +++ b/httpie/httpie.py @@ -34,10 +34,11 @@ class KeyValueType(object): self.separators = separators def __call__(self, string): + found = dict([ + (string.find(sep), sep) for sep in self.separators + if string.find(sep) != -1 + ]) - found = {string.find(sep): sep - for sep in self.separators - if string.find(sep) != -1} if not found: raise argparse.ArgumentTypeError( '"%s" is not a valid value' % string) @@ -148,8 +149,8 @@ def main(): verify=True if args.verify == 'yes' else args.verify, timeout=args.timeout, auth=(args.auth.key, args.auth.value) if args.auth else None, - proxies={proxy.key: proxy.value for proxy in args.proxy}, - files={os.path.basename(f.name): f for f in args.file} + proxies=dict([(p.key, p.value) for p in args.proxy]), + files=dict([(os.path.basename(f.name), f) for f in args.file]), ) except (KeyboardInterrupt, SystemExit) as e: sys.stderr.write('\n')