]> granicus.if.org Git - python/commitdiff
Issue #25093: Fix test_tcl's testloadWithUNC for paths with spaces
authorZachary Ware <zachary.ware@gmail.com>
Tue, 13 Oct 2015 04:27:58 +0000 (23:27 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Tue, 13 Oct 2015 04:27:58 +0000 (23:27 -0500)
Patch by Serhiy Storchaka.

Lib/test/test_tcl.py

index 66e9d49dfeaf32f035c077a25d4fcb6e84ec1b56..b6565631b7f011d89a9656efadf04a8f549a5aad 100644 (file)
@@ -1,5 +1,6 @@
 import unittest
 import re
+import subprocess
 import sys
 import os
 from test import support
@@ -246,11 +247,10 @@ class TclTest(unittest.TestCase):
 
         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