Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e075537

Browse files
committed
Issue #27322: Merge from 3.6
2 parents dbd9cbf + 408b78c commit e075537

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

Lib/test/test_compileall.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,8 @@ def test_compile_files(self):
103103
force=False, quiet=2))
104104

105105
def test_compile_path(self):
106-
# Exclude Lib/test/ which contains invalid Python files like
107-
# Lib/test/badsyntax_pep3120.py
108-
testdir = os.path.realpath(os.path.dirname(__file__))
109-
if testdir in sys.path:
110-
self.addCleanup(setattr, sys, 'path', sys.path)
111-
112-
sys.path = list(sys.path)
113-
try:
114-
sys.path.remove(testdir)
115-
except ValueError:
116-
pass
117-
118-
self.assertTrue(compileall.compile_path(quiet=2))
106+
with test.test_importlib.util.import_state(path=[self.directory]):
107+
self.assertTrue(compileall.compile_path(quiet=2))
119108

120109
with test.test_importlib.util.import_state(path=[self.directory]):
121110
self.add_bad_source_file()

0 commit comments

Comments
 (0)