summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter/test/test_tkinter/test_loadtk.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/tkinter/test/test_tkinter/test_loadtk.py')
-rw-r--r--Lib/tkinter/test/test_tkinter/test_loadtk.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/tkinter/test/test_tkinter/test_loadtk.py b/Lib/tkinter/test/test_tkinter/test_loadtk.py
index 8f1a085..bab7bcd 100644
--- a/Lib/tkinter/test/test_tkinter/test_loadtk.py
+++ b/Lib/tkinter/test/test_tkinter/test_loadtk.py
@@ -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