We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acf7188 commit aa83a6aCopy full SHA for aa83a6a
1 file changed
Lib/test/test_embed.py
@@ -603,12 +603,13 @@ def test_init_run_main_code_exitcode(self):
603
code)
604
605
def test_init_run_main_script_exitcode(self):
606
- with tempfile.NamedTemporaryFile(mode='w', suffix='.py') as tmp:
607
- tmp.write(CODE_EXITCODE_123)
608
- tmp.flush()
+ with tempfile.TemporaryDirectory() as tmpdir:
+ filename = os.path.join(tmpdir, 'script.py')
+ with open(filename, 'w') as fp:
609
+ fp.write(CODE_EXITCODE_123)
610
611
self.run_embedded_interpreter("test_init_run_main_script_exitcode",
- tmp.name)
612
+ filename)
613
614
def test_init_run_main_interactive_exitcode(self):
615
code = CODE_EXITCODE_123
0 commit comments