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