mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
Fix ResourceWarning from subprocess pipes being left open.
This commit is contained in:
parent
994ad6c775
commit
ab747a7daa
@ -178,6 +178,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
|
||||
(p, e) = self.STRINGS[-1]
|
||||
process = subprocess.Popen([sys.executable, "-mquopri"],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
self.addCleanup(process.stdout.close)
|
||||
cout, cerr = process.communicate(p)
|
||||
# On Windows, Python will output the result to stdout using
|
||||
# CRLF, as the mode of stdout is text mode. To compare this
|
||||
@ -193,6 +194,7 @@ zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz''')
|
||||
(p, e) = self.STRINGS[-1]
|
||||
process = subprocess.Popen([sys.executable, "-mquopri", "-d"],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
||||
self.addCleanup(process.stdout.close)
|
||||
cout, cerr = process.communicate(e)
|
||||
cout = cout.decode('latin-1')
|
||||
p = p.decode('latin-1')
|
||||
|
Loading…
Reference in New Issue
Block a user