Skip to content

Commit d25f4f8

Browse files
committed
Use the presence of builtins rather than configparser to indicate the future/src folder
1 parent 5cbeb4b commit d25f4f8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@
135135
'_markupbase',
136136
'_thread',
137137
'builtins',
138-
# 'configparser',
138+
# Catch the case that configparser is in the build folder
139+
# from a previous version of `future`:
140+
'configparser',
139141
'copyreg',
140142
'html',
141143
'http',

src/future/standard_library/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,9 @@ def __enter__(self):
755755
self.old_sys_modules = copy.copy(sys.modules)
756756
if sys.version_info[0] < 3:
757757
return
758-
FUTURE_SOURCE_SUBFOLDERS = ['future', 'past', 'libfuturize', 'configparser']
758+
# The presence of all these indicates we've found our source folder,
759+
# because `builtins` won't have been installed in site-packages by setup.py:
760+
FUTURE_SOURCE_SUBFOLDERS = ['future', 'past', 'libfuturize', 'libpasteurize', 'builtins']
759761

760762
# Look for the future source folder:
761763
for folder in self.old_sys_path:

0 commit comments

Comments
 (0)