File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 11import atexit
22import os
33import subprocess
4- import tempfile
54import textwrap
65import unittest
76from test import support
87from test .support import SuppressCrashReport , script_helper
8+ from test .support import os_helper
99from test .support import threading_helper
1010
1111class GeneralTest (unittest .TestCase ):
@@ -209,11 +209,8 @@ def callback():
209209 _testcapi.set_nomemory(0)
210210 """ )
211211
212- with tempfile .NamedTemporaryFile (mode = 'w' , suffix = '.py' ) as f :
213- f .write (code )
214- f .flush ()
215- script = f .name
216-
212+ with os_helper .temp_dir () as temp_dir :
213+ script = script_helper .make_script (temp_dir , 'test_atexit_script' , code )
217214 with SuppressCrashReport ():
218215 with script_helper .spawn_python (script ,
219216 stderr = subprocess .PIPE ) as proc :
You can’t perform that action at this time.
0 commit comments