mirror of
https://github.com/httpie/cli.git
synced 2024-11-25 01:03:27 +01:00
Merge pull request #2 from flashingpumpkin/master
Added Python 2.6 compatibility.
This commit is contained in:
commit
f90ae113e4
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user