[Python-checkins] r87682 - in python/branches/py3k: Lib/tkinter/test/test_tkinter/test_loadtk.py Misc/ACKS

victor.stinner python-checkins at python.org
Mon Jan 3 15:30:43 CET 2011


Author: victor.stinner
Date: Mon Jan  3 15:30:43 2011
New Revision: 87682

Log:
test_tkinter: use a context manager to close directly the pipe

Patch written by Nadeem Vawda

Modified:
   python/branches/py3k/Lib/tkinter/test/test_tkinter/test_loadtk.py
   python/branches/py3k/Misc/ACKS

Modified: python/branches/py3k/Lib/tkinter/test/test_tkinter/test_loadtk.py
==============================================================================
--- python/branches/py3k/Lib/tkinter/test/test_tkinter/test_loadtk.py	(original)
+++ python/branches/py3k/Lib/tkinter/test/test_tkinter/test_loadtk.py	Mon Jan  3 15:30:43 2011
@@ -31,7 +31,8 @@
                 # 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
 

Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS	(original)
+++ python/branches/py3k/Misc/ACKS	Mon Jan  3 15:30:43 2011
@@ -866,6 +866,7 @@
 Atul Varma
 Dmitry Vasiliev
 Alexandre Vassalotti
+Nadeem Vawda
 Frank Vercruesse
 Mike Verdone
 Jaap Vermeulen


More information about the Python-checkins mailing list