]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Attempt to fix #15415 on Windows
authorNick Coghlan <ncoghlan@gmail.com>
Mon, 29 Jul 2013 05:18:09 +0000 (15:18 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Mon, 29 Jul 2013 05:18:09 +0000 (15:18 +1000)
Lib/test/test_startfile.py

index 5a9c2def24253ab833d9f15ccda30b9ee64e9053..68e35b3d3bedcac3a48427fe885191998a57ea1f 100644 (file)
@@ -21,12 +21,12 @@ class TestCase(unittest.TestCase):
         self.assertRaises(OSError, startfile, "nonexisting.vbs")
 
     def test_empty(self):
-        # Switch to an existing, but safe, working directory to let the
-        # cleanup code do its thing without permission errors.
-        with support.temp_cwd(path=path.dirname(sys.executable)):
-            empty = path.join(path.dirname(__file__), "empty.vbs")
+        # startfile is a little odd when it comes to handling absolute
+        # paths, so we briefly switch to the main test directory
+        # and use a relative path
+        with support.change_cwd(support.TEST_HOME):
+            empty = "empty.vbs"
             startfile(empty)
-            startfile(empty, "open")
 
 def test_main():
     support.run_unittest(TestCase)