Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c06c0ae

Browse files
committed
Third attempt to fix #15415 on Windows
With help from jkloth on IRC, so it will hopefully work this time :)
1 parent 2f253e8 commit c06c0ae

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Lib/test/test_startfile.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ def test_nonexisting(self):
2121
self.assertRaises(OSError, startfile, "nonexisting.vbs")
2222

2323
def test_empty(self):
24-
# startfile is a little odd when it comes to handling absolute
25-
# paths, so we briefly switch to the main test directory
26-
# and use a relative path
27-
with support.change_cwd(support.TEST_HOME):
28-
empty = "empty.vbs"
24+
# We need to make sure the child process starts in a directory
25+
# we're not about to delete. If we're running under -j, that
26+
# means the test harness provided directory isn't a safe option.
27+
# See http://bugs.python.org/issue15526 for more details
28+
with support.change_cwd(path.dirname(sys.executable)):
29+
empty = path.join(path.dirname(__file__), "empty.vbs")
2930
startfile(empty)
31+
startfile(empty, "open")
3032

3133
def test_main():
3234
support.run_unittest(TestCase)

0 commit comments

Comments
 (0)