mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #20778: Fix modulefinder to work with bytecode-only modules.
Bug filed and initial attempt at a patch by Bohuslav Kabrda.
This commit is contained in:
parent
815b41b1cd
commit
298bb96776
3 changed files with 23 additions and 1 deletions
|
@ -287,7 +287,7 @@ class ModuleFinder:
|
|||
if fp.read(4) != imp.get_magic():
|
||||
self.msgout(2, "raise ImportError: Bad magic number", pathname)
|
||||
raise ImportError("Bad magic number in %s" % pathname)
|
||||
fp.read(4)
|
||||
fp.read(8) # Skip mtime and size.
|
||||
co = marshal.load(fp)
|
||||
else:
|
||||
co = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue