mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #12618: py_compile cannot create files in current directory
Initial patch by Sjoerd de Vries.
This commit is contained in:
parent
7be8f68d37
commit
22b9b37915
4 changed files with 16 additions and 1 deletions
|
@ -39,6 +39,15 @@ class PyCompileTests(unittest.TestCase):
|
|||
py_compile.compile(self.source_path)
|
||||
self.assertTrue(os.path.exists(self.cache_path))
|
||||
|
||||
def test_cwd(self):
|
||||
cwd = os.getcwd()
|
||||
os.chdir(self.directory)
|
||||
py_compile.compile(os.path.basename(self.source_path),
|
||||
os.path.basename(self.pyc_path))
|
||||
os.chdir(cwd)
|
||||
self.assertTrue(os.path.exists(self.pyc_path))
|
||||
self.assertFalse(os.path.exists(self.cache_path))
|
||||
|
||||
def test_relative_path(self):
|
||||
py_compile.compile(os.path.relpath(self.source_path),
|
||||
os.path.relpath(self.pyc_path))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue