Commit d916fa24 authored by Jason R. Coombs's avatar Jason R. Coombs

Feed the hobgoblins (delint).

parent cfb0d71a
...@@ -39,6 +39,7 @@ def strip_module(filename): ...@@ -39,6 +39,7 @@ def strip_module(filename):
filename = filename[:-6] filename = filename[:-6]
return filename return filename
def sorted_walk(dir): def sorted_walk(dir):
"""Do os.walk in a reproducible way, """Do os.walk in a reproducible way,
independent of indeterministic filesystem readdir order independent of indeterministic filesystem readdir order
...@@ -48,6 +49,7 @@ def sorted_walk(dir): ...@@ -48,6 +49,7 @@ def sorted_walk(dir):
files.sort() files.sort()
yield base, dirs, files yield base, dirs, files
def write_stub(resource, pyfile): def write_stub(resource, pyfile):
_stub_template = textwrap.dedent(""" _stub_template = textwrap.dedent("""
def __bootstrap__(): def __bootstrap__():
...@@ -252,15 +254,17 @@ class bdist_egg(Command): ...@@ -252,15 +254,17 @@ class bdist_egg(Command):
pattern = r'(?P<name>.+)\.(?P<magic>[^.]+)\.pyc' pattern = r'(?P<name>.+)\.(?P<magic>[^.]+)\.pyc'
m = re.match(pattern, name) m = re.match(pattern, name)
path_new = os.path.join(base, os.pardir, m.group('name') + '.pyc') path_new = os.path.join(
log.info("Renaming file from [%s] to [%s]" % (path_old, path_new)) base, os.pardir, m.group('name') + '.pyc')
log.info(
"Renaming file from [%s] to [%s]"
% (path_old, path_new))
try: try:
os.remove(path_new) os.remove(path_new)
except OSError: except OSError:
pass pass
os.rename(path_old, path_new) os.rename(path_old, path_new)
def zip_safe(self): def zip_safe(self):
safe = getattr(self.distribution, 'zip_safe', None) safe = getattr(self.distribution, 'zip_safe', None)
if safe is not None: if safe is not None:
...@@ -412,7 +416,7 @@ def scan_module(egg_dir, base, name, stubs): ...@@ -412,7 +416,7 @@ def scan_module(egg_dir, base, name, stubs):
elif sys.version_info < (3, 7): elif sys.version_info < (3, 7):
skip = 12 # skip magic & date & file size skip = 12 # skip magic & date & file size
else: else:
skip = 16 # skip magic & reserved? & date & file size skip = 16 # skip magic & reserved? & date & file size
f = open(filename, 'rb') f = open(filename, 'rb')
f.read(skip) f.read(skip)
code = marshal.load(f) code = marshal.load(f)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment