Skip to content

Commit 1bab356

Browse files
committed
Only apply findall patch on affected Pythons.
1 parent 336258f commit 1bab356

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

setuptools/__init__.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Extensions to the 'distutils' for large or complex distributions"""
22

33
import os
4+
import sys
45
import functools
56
import distutils.core
67
import distutils.filelist
@@ -17,7 +18,7 @@
1718

1819
__all__ = [
1920
'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require',
20-
'find_packages'
21+
'find_packages',
2122
]
2223

2324
__version__ = setuptools.version.__version__
@@ -171,5 +172,14 @@ def findall(dir=os.curdir):
171172
return list(files)
172173

173174

174-
# fix findall bug in distutils (http://bugs.python.org/issue12885)
175-
distutils.filelist.findall = findall
175+
has_issue_12885 = (
176+
sys.version_info < (3, 4, 6)
177+
or
178+
(3, 5) < sys.version_info <= (3, 5, 3)
179+
or
180+
(3, 6) < sys.version_info
181+
)
182+
183+
if has_issue_12885:
184+
# fix findall bug in distutils (http://bugs.python.org/issue12885)
185+
distutils.filelist.findall = findall

0 commit comments

Comments
 (0)