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

Skip to content

Commit 2f253e8

Browse files
committed
Attempt to fix #15415 on Windows
1 parent 015b453 commit 2f253e8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/test/test_startfile.py

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

2323
def test_empty(self):
24-
# Switch to an existing, but safe, working directory to let the
25-
# cleanup code do its thing without permission errors.
26-
with support.temp_cwd(path=path.dirname(sys.executable)):
27-
empty = path.join(path.dirname(__file__), "empty.vbs")
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"
2829
startfile(empty)
29-
startfile(empty, "open")
3030

3131
def test_main():
3232
support.run_unittest(TestCase)

0 commit comments

Comments
 (0)