File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Lib/test/test_peg_generator Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import sysconfig
22import textwrap
33import unittest
4- from distutils .tests .support import TempdirManager
4+ import os
5+ import shutil
6+ import tempfile
57from pathlib import Path
68
79from test import test_tools
@@ -68,20 +70,21 @@ def test_parse(self):
6870"""
6971
7072
71- class TestCParser (TempdirManager , unittest .TestCase ):
73+ class TestCParser (unittest .TestCase ):
7274 def setUp (self ):
7375 self ._backup_config_vars = dict (sysconfig ._CONFIG_VARS )
7476 cmd = support .missing_compiler_executable ()
7577 if cmd is not None :
7678 self .skipTest ("The %r command is not found" % cmd )
77- super ( TestCParser , self ). setUp ()
78- self .tmp_path = self .mkdtemp ()
79+ self . old_cwd = os . getcwd ()
80+ self .tmp_path = tempfile .mkdtemp ()
7981 change_cwd = os_helper .change_cwd (self .tmp_path )
8082 change_cwd .__enter__ ()
8183 self .addCleanup (change_cwd .__exit__ , None , None , None )
8284
8385 def tearDown (self ):
84- super (TestCParser , self ).tearDown ()
86+ os .chdir (self .old_cwd )
87+ shutil .rmtree (self .tmp_path )
8588 sysconfig ._CONFIG_VARS .clear ()
8689 sysconfig ._CONFIG_VARS .update (self ._backup_config_vars )
8790
You can’t perform that action at this time.
0 commit comments