diff --git a/httpie/httpie.py b/httpie/httpie.py index 651e5933..793aecf6 100755 --- a/httpie/httpie.py +++ b/httpie/httpie.py @@ -27,10 +27,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) @@ -141,8 +142,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')