Skip to content

Commit

Permalink
Allow missing .py files if .pyc is present
Browse files Browse the repository at this point in the history
  • Loading branch information
tucked committed Mar 11, 2020
1 parent 93cf9ed commit b86c24a
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -58,9 +58,11 @@ def sources(cls, interpreter):
# install files needed to run site.py
for req in cls.modules():
stdlib_path = interpreter.stdlib_path("{}.py".format(req))
yield PathRefToDest(stdlib_path, dest=cls.to_stdlib)
comp = stdlib_path.parent / "{}.pyc".format(req)
if comp.exists():
comp_exists = comp.exists()
if stdlib_path.exists() or not comp_exists:
yield PathRefToDest(stdlib_path, dest=cls.to_stdlib)
if comp_exists:
yield PathRefToDest(comp, dest=cls.to_stdlib)

def to_stdlib(self, src):
Expand Down

0 comments on commit b86c24a

Please sign in to comment.