mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Issue #15056: imp.cache_from_source() and source_from_cache() raise
NotimplementedError when sys.implementation.cache_tag is None. Thanks to Pranav Ravichandran for taking an initial stab at the patch.
This commit is contained in:
parent
bf7eab077f
commit
19a2f5961c
6 changed files with 3875 additions and 3802 deletions
|
@ -58,9 +58,12 @@ def source_from_cache(path):
|
|||
|
||||
The .pyc/.pyo file does not need to exist; this simply returns the path to
|
||||
the .py file calculated to correspond to the .pyc/.pyo file. If path does
|
||||
not conform to PEP 3147 format, ValueError will be raised.
|
||||
not conform to PEP 3147 format, ValueError will be raised. If
|
||||
sys.implementation.cache_tag is None then NotImplementedError is raised.
|
||||
|
||||
"""
|
||||
if sys.implementation.cache_tag is None:
|
||||
raise NotImplementedError('sys.implementation.cache_tag is None')
|
||||
head, pycache_filename = os.path.split(path)
|
||||
head, pycache = os.path.split(head)
|
||||
if pycache != _bootstrap._PYCACHE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue