##// END OF EJS Templates
Merge pull request #8930 from jakirkham/fix_resource_warning_devnull_ipy3...
Min RK -
r21770:47f3bb46 merge
parent child Browse files
Show More
@@ -15,6 +15,7 b' from __future__ import absolute_import'
15 #-----------------------------------------------------------------------------
15 #-----------------------------------------------------------------------------
16 # Imports
16 # Imports
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18 import atexit
18 import codecs
19 import codecs
19 from contextlib import contextmanager
20 from contextlib import contextmanager
20 import io
21 import io
@@ -86,6 +87,7 b' class IOStream:'
86
87
87 # setup stdin/stdout/stderr to sys.stdin/sys.stdout/sys.stderr
88 # setup stdin/stdout/stderr to sys.stdin/sys.stdout/sys.stderr
88 devnull = open(os.devnull, 'w')
89 devnull = open(os.devnull, 'w')
90 atexit.register(devnull.close)
89 stdin = IOStream(sys.stdin, fallback=devnull)
91 stdin = IOStream(sys.stdin, fallback=devnull)
90 stdout = IOStream(sys.stdout, fallback=devnull)
92 stdout = IOStream(sys.stdout, fallback=devnull)
91 stderr = IOStream(sys.stderr, fallback=devnull)
93 stderr = IOStream(sys.stderr, fallback=devnull)
General Comments 0
You need to be logged in to leave comments. Login now