Skip to content

Commit

Permalink
Fix #212: Add ability to select UNCHECKED_HASH pyc mode. (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
wimglenn authored Dec 13, 2023
1 parent a552402 commit 573f741
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion distlib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,10 @@ def byte_compile(self,
compile_kwargs = {}
if hashed_invalidation and hasattr(py_compile,
'PycInvalidationMode'):
if not isinstance(hashed_invalidation, py_compile.PycInvalidationMode):
hashed_invalidation = py_compile.PycInvalidationMode.CHECKED_HASH
compile_kwargs[
'invalidation_mode'] = py_compile.PycInvalidationMode.CHECKED_HASH
'invalidation_mode'] = hashed_invalidation
py_compile.compile(path, dpath, diagpath, True,
**compile_kwargs) # raise error
self.record_as_written(dpath)
Expand Down
2 changes: 1 addition & 1 deletion distlib/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def install(self, paths, maker, **kwargs):
installed, and the headers, scripts, data and dist-info metadata are
not written. If kwarg ``bytecode_hashed_invalidation`` is True, written
bytecode will try to use file-hash based invalidation (PEP-552) on
supported interpreter versions (CPython 2.7+).
supported interpreter versions (CPython 3.7+).
The return value is a :class:`InstalledDistribution` instance unless
``options.lib_only`` is True, in which case the return value is ``None``.
Expand Down

0 comments on commit 573f741

Please sign in to comment.