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

Use a defaultdict and count to track seen items

parent 3744e23d
...@@ -7,6 +7,8 @@ import fnmatch ...@@ -7,6 +7,8 @@ import fnmatch
import textwrap import textwrap
import io import io
import distutils.errors import distutils.errors
import collections
import itertools
try: try:
...@@ -195,14 +197,13 @@ class build_py(orig.build_py, Mixin2to3): ...@@ -195,14 +197,13 @@ class build_py(orig.build_py, Mixin2to3):
os.path.join(src_dir, convert_path(pattern)), os.path.join(src_dir, convert_path(pattern)),
) )
) )
seen = {} seen = collections.defaultdict(itertools.count)
return [ return [
fn fn
for fn in files for fn in files
if fn not in bad if fn not in bad
# ditch dupes # ditch dupes
and fn not in seen and not next(seen[fn])
and seen.setdefault(fn, 1)
] ]
......
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