mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
test_tkinter: use a context manager to close directly the pipe
Patch written by Nadeem Vawda
This commit is contained in:
parent
5c85e3f390
commit
270fe40831
2 changed files with 3 additions and 1 deletions
|
@ -31,7 +31,8 @@ class TkLoadTest(unittest.TestCase):
|
||||||
# doesn't actually carry through to the process level
|
# doesn't actually carry through to the process level
|
||||||
# because they don't support unsetenv
|
# because they don't support unsetenv
|
||||||
# If that's the case, abort.
|
# 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:
|
if display:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -866,6 +866,7 @@ Andrew Vant
|
||||||
Atul Varma
|
Atul Varma
|
||||||
Dmitry Vasiliev
|
Dmitry Vasiliev
|
||||||
Alexandre Vassalotti
|
Alexandre Vassalotti
|
||||||
|
Nadeem Vawda
|
||||||
Frank Vercruesse
|
Frank Vercruesse
|
||||||
Mike Verdone
|
Mike Verdone
|
||||||
Jaap Vermeulen
|
Jaap Vermeulen
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue