diff --git a/distlib/util.py b/distlib/util.py index ba58858..5a39912 100644 --- a/distlib/util.py +++ b/distlib/util.py @@ -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) diff --git a/distlib/wheel.py b/distlib/wheel.py index 4a5a30e..6e7f019 100644 --- a/distlib/wheel.py +++ b/distlib/wheel.py @@ -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``.