Skip to content

Commit c69cfcd

Browse files
authored
closes gh-99508: fix TypeError in Lib/importlib/_bootstrap_external.py (GH-99635)
1 parent 57dfb1c commit c69cfcd

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Lib/importlib/_bootstrap_external.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,8 @@ def get_code(self, fullname):
11441144
source_mtime is not None):
11451145
if hash_based:
11461146
if source_hash is None:
1147-
source_hash = _imp.source_hash(source_bytes)
1147+
source_hash = _imp.source_hash(_RAW_MAGIC_NUMBER,
1148+
source_bytes)
11481149
data = _code_to_hash_pyc(code_object, source_hash, check_source)
11491150
else:
11501151
data = _code_to_timestamp_pyc(code_object, source_mtime,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix ``TypeError`` in ``Lib/importlib/_bootstrap_external.py`` while calling
2+
``_imp.source_hash()``.

0 commit comments

Comments
 (0)