mirror of https://github.com/python/cpython
Issue #27322: Merge from 3.6
This commit is contained in:
commit
e075537432
|
@ -103,19 +103,8 @@ class CompileallTests(unittest.TestCase):
|
|||
force=False, quiet=2))
|
||||
|
||||
def test_compile_path(self):
|
||||
# Exclude Lib/test/ which contains invalid Python files like
|
||||
# Lib/test/badsyntax_pep3120.py
|
||||
testdir = os.path.realpath(os.path.dirname(__file__))
|
||||
if testdir in sys.path:
|
||||
self.addCleanup(setattr, sys, 'path', sys.path)
|
||||
|
||||
sys.path = list(sys.path)
|
||||
try:
|
||||
sys.path.remove(testdir)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
self.assertTrue(compileall.compile_path(quiet=2))
|
||||
with test.test_importlib.util.import_state(path=[self.directory]):
|
||||
self.assertTrue(compileall.compile_path(quiet=2))
|
||||
|
||||
with test.test_importlib.util.import_state(path=[self.directory]):
|
||||
self.add_bad_source_file()
|
||||
|
|
Loading…
Reference in New Issue