Skip to content

Commit 93710c1

Browse files
authored
bpo-29763: Use support.unlink instead of os.unlink (pythonGH-624)
support.unlink waits for the files to be removed before returning
1 parent 482f7a2 commit 93710c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_site.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,15 @@ def _create_underpth_exe(self, lines):
501501
print(line, file=f)
502502
return exe_file
503503
except:
504-
os.unlink(_pth_file)
505-
os.unlink(exe_file)
504+
test.support.unlink(_pth_file)
505+
test.support.unlink(exe_file)
506506
raise
507507

508508
@classmethod
509509
def _cleanup_underpth_exe(self, exe_file):
510510
_pth_file = os.path.splitext(exe_file)[0] + '._pth'
511-
os.unlink(_pth_file)
512-
os.unlink(exe_file)
511+
test.support.unlink(_pth_file)
512+
test.support.unlink(exe_file)
513513

514514
@classmethod
515515
def _calc_sys_path_for_underpth_nosite(self, sys_prefix, lines):

0 commit comments

Comments
 (0)