Do not attempt to close stdin/stdout file objects
This commit is contained in:
parent
8ac344daf2
commit
4a5b924d37
1 changed files with 7 additions and 3 deletions
|
|
@ -3758,9 +3758,13 @@ def start(options, input, output):
|
||||||
out_string = scourString(in_string, options).encode("UTF-8")
|
out_string = scourString(in_string, options).encode("UTF-8")
|
||||||
output.write(out_string)
|
output.write(out_string)
|
||||||
|
|
||||||
# Close input and output files
|
# Close input and output files (but do not attempt to close stdin/stdout!)
|
||||||
input.close()
|
if input is not sys.stdin:
|
||||||
output.close()
|
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()
|
||||||
|
|
||||||
end = walltime()
|
end = walltime()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue