From 4410f91dad3a780f52da75bff0103832d7ed7f2b Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 18 Sep 2016 03:25:19 +0200 Subject: [PATCH] Fix logic in previous commit --- scour/scour.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scour/scour.py b/scour/scour.py index 5801962..13cc57e 100644 --- a/scour/scour.py +++ b/scour/scour.py @@ -3759,12 +3759,10 @@ def start(options, input, output): output.write(out_string) # Close input and output files (but do not attempt to close stdin/stdout!) - if input is not sys.stdin: - if hasattr(input, 'buffer') and input is not sys.stdin.buffer: - input.close() - if output is not sys.stdout: - if hasattr(output, 'buffer') and output is not sys.stdout.buffer: - output.close() + if not ((input is sys.stdin) or (hasattr(input, 'buffer') and input is sys.stdin.buffer)): + input.close() + if not ((output is sys.stdout) or (hasattr(output, 'buffer') and output is sys.stdout.buffer)): + output.close() end = walltime()