From b567104267c4de7b16af1498906cd7fe61d33579 Mon Sep 17 00:00:00 2001 From: Alen Mujezinovic Date: Tue, 28 Feb 2012 13:33:33 +0000 Subject: [PATCH] Removed the lists in favour of generators --- httpie/httpie.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/httpie/httpie.py b/httpie/httpie.py index 49c35aab..2588c8a1 100755 --- a/httpie/httpie.py +++ b/httpie/httpie.py @@ -34,10 +34,10 @@ class KeyValueType(object): self.separators = separators def __call__(self, string): - found = dict([ + found = dict( (string.find(sep), sep) for sep in self.separators if string.find(sep) != -1 - ]) + ) if not found: raise argparse.ArgumentTypeError( @@ -149,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=dict([(p.key, p.value) for p in args.proxy]), - files=dict([(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')