Skip to content

Commit 264f9bc

Browse files
committed
Another attempt at getting the test runner working on travis-ci on Py3
1 parent ce904ad commit 264f9bc

File tree

4 files changed

+28
-30
lines changed

4 files changed

+28
-30
lines changed

future/backports/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from __future__ import absolute_import
33
import sys
44
__future_module__ = True
5-
6-
from future.moves import import_top_level_modules
5+
from future.standard_library import import_top_level_modules
76

87
if sys.version_info[0] == 3:
98
import_top_level_modules()

future/moves/__init__.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,7 @@
22
from __future__ import absolute_import
33
import sys
44
__future_module__ = True
5-
6-
TOP_LEVEL_MODULES = ['builtins',
7-
'configparser',
8-
'copyreg',
9-
'html',
10-
'http',
11-
'queue',
12-
'reprlib',
13-
'socketserver',
14-
'test',
15-
'tkinter',
16-
'winreg',
17-
'xmlrpc',
18-
'_dummy_thread',
19-
'_markupbase',
20-
'_thread',
21-
]
22-
23-
def import_top_level_modules():
24-
from future.standard_library import exclude_local_folder_imports
25-
with exclude_local_folder_imports(*TOP_LEVEL_MODULES):
26-
for m in TOP_LEVEL_MODULES:
27-
try:
28-
__import__(m)
29-
except ImportError: # e.g. winreg
30-
pass
5+
from future.standard_library import import_top_level_modules
316

327
if sys.version_info[0] == 3:
338
import_top_level_modules()

future/standard_library/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,3 +784,28 @@ def __exit__(self, *args):
784784
sys.path = self.old_sys_path
785785
for m in set(self.old_sys_modules.keys()) - set(sys.modules.keys()):
786786
sys.modules[m] = self.old_sys_modules[m]
787+
788+
TOP_LEVEL_MODULES = ['builtins',
789+
'configparser',
790+
'copyreg',
791+
'html',
792+
'http',
793+
'queue',
794+
'reprlib',
795+
'socketserver',
796+
'test',
797+
'tkinter',
798+
'winreg',
799+
'xmlrpc',
800+
'_dummy_thread',
801+
'_markupbase',
802+
'_thread',
803+
]
804+
805+
def import_top_level_modules():
806+
with exclude_local_folder_imports(*TOP_LEVEL_MODULES):
807+
for m in TOP_LEVEL_MODULES:
808+
try:
809+
__import__(m)
810+
except ImportError: # e.g. winreg
811+
pass

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
import sys
66

77
import future
8-
import future.moves # to allow running this script in the python-future source folder
98
from future.standard_library import exclude_local_folder_imports
109

1110

12-
with exclude_local_folder_imports('configparser'):
11+
with exclude_local_folder_imports('configparser', 'reprlib'):
1312
try:
1413
from setuptools import setup
1514
except ImportError:

0 commit comments

Comments
 (0)