mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
test_tkinter: use a context manager to close directly the pipe
Patch written by Nadeem Vawda
This commit is contained in:
@@ -31,7 +31,8 @@ class TkLoadTest(unittest.TestCase):
|
||||
# doesn't actually carry through to the process level
|
||||
# because they don't support unsetenv
|
||||
# If that's the case, abort.
|
||||
display = os.popen('echo $DISPLAY').read().strip()
|
||||
with os.popen('echo $DISPLAY') as pipe:
|
||||
display = pipe.read().strip()
|
||||
if display:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user