File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import test .support
6
6
from test .support import threading_helper
7
- from test .support import verbose , cpython_only
7
+ from test .support import verbose , cpython_only , os_helper
8
8
from test .support .import_helper import import_module
9
9
from test .support .script_helper import assert_python_ok , assert_python_failure
10
10
19
19
import subprocess
20
20
import signal
21
21
import textwrap
22
- import traceback
23
22
24
23
from unittest import mock
25
24
from test import lock_tests
@@ -1342,9 +1341,9 @@ def run(self):
1342
1341
def test_multithread_modify_file_noerror (self ):
1343
1342
# See issue25872
1344
1343
def modify_file ():
1345
- with open (__file__ , 'a ' ) as fp :
1344
+ with open (os_helper . TESTFN , 'w' , encoding = 'utf-8 ' ) as fp :
1346
1345
fp .write (' ' )
1347
- traceback . format_stack ( )
1346
+ self . addCleanup ( os_helper . unlink , os_helper . TESTFN )
1348
1347
1349
1348
threads = [
1350
1349
threading .Thread (target = modify_file )
You can’t perform that action at this time.
0 commit comments