From 92dd030c22a48f8e65638e8cbac633318f203132 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 24 Sep 2016 16:34:20 -0700 Subject: [PATCH] minor cleanups --- pathod/pathoc.py | 4 ++-- pathod/pathoc_cmdline.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pathod/pathoc.py b/pathod/pathoc.py index a8923013b..c62993bbe 100644 --- a/pathod/pathoc.py +++ b/pathod/pathoc.py @@ -536,11 +536,11 @@ def main(args): # pragma: no cover if ret and args.oneshot: return # We consume the queue when we can, so it doesn't build up. - for i_ in p.wait(timeout=0, finish=False): + for _ in p.wait(timeout=0, finish=False): pass except exceptions.NetlibException: break - for i_ in p.wait(timeout=0.01, finish=True): + for _ in p.wait(timeout=0.01, finish=True): pass except exceptions.TcpException as v: print(str(v), file=sys.stderr) diff --git a/pathod/pathoc_cmdline.py b/pathod/pathoc_cmdline.py index 21d0efc62..50f584e2f 100644 --- a/pathod/pathoc_cmdline.py +++ b/pathod/pathoc_cmdline.py @@ -210,8 +210,8 @@ def args_pathoc(argv, stdout=sys.stdout, stderr=sys.stderr): reqs = [] for r in args.requests: if os.path.isfile(r): - data = open(r).read() - r = data + with open(r) as f: + r = f.read() try: reqs.append(language.parse_pathoc(r, args.use_http2)) except language.ParseException as v: