closes gh-99508: fix TypeError in Lib/importlib/_bootstrap_external.py (GH-99635)

This commit is contained in:
Nikita Sobolev 2022-11-24 01:47:31 +03:00 committed by GitHub
parent 57dfb1c4c8
commit c69cfcdb11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -1144,7 +1144,8 @@ def get_code(self, fullname):
source_mtime is not None):
if hash_based:
if source_hash is None:
source_hash = _imp.source_hash(source_bytes)
source_hash = _imp.source_hash(_RAW_MAGIC_NUMBER,
source_bytes)
data = _code_to_hash_pyc(code_object, source_hash, check_source)
else:
data = _code_to_timestamp_pyc(code_object, source_mtime,

View file

@ -0,0 +1,2 @@
Fix ``TypeError`` in ``Lib/importlib/_bootstrap_external.py`` while calling
``_imp.source_hash()``.