[Python-checkins] cpython (3.4): Issue #25093: Fix test_tcl's testloadWithUNC for paths with spaces

zach.ware python-checkins at python.org
Tue Oct 13 00:32:10 EDT 2015


https://hg.python.org/cpython/rev/6eb49f521336
changeset:   98720:6eb49f521336
branch:      3.4
parent:      98708:b07ac3c6bb98
user:        Zachary Ware <zachary.ware at gmail.com>
date:        Mon Oct 12 23:27:58 2015 -0500
summary:
  Issue #25093: Fix test_tcl's testloadWithUNC for paths with spaces

Patch by Serhiy Storchaka.

files:
  Lib/test/test_tcl.py |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -1,5 +1,6 @@
 import unittest
 import re
+import subprocess
 import sys
 import os
 from test import support
@@ -246,11 +247,10 @@
 
         with support.EnvironmentVarGuard() as env:
             env.unset("TCL_LIBRARY")
-            f = os.popen('%s -c "import tkinter; print(tkinter)"' % (unc_name,))
+            stdout = subprocess.check_output(
+                    [unc_name, '-c', 'import tkinter; print(tkinter)'])
 
-        self.assertIn('tkinter', f.read())
-        # exit code must be zero
-        self.assertEqual(f.close(), None)
+        self.assertIn(b'tkinter', stdout)
 
     def test_exprstring(self):
         tcl = self.interp

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list