|
|
|
@ -146,11 +146,11 @@ from inspect import isabstract |
|
|
|
|
|
|
|
try: |
|
|
|
import threading |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
threading = None |
|
|
|
try: |
|
|
|
import multiprocessing.process |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
multiprocessing = None |
|
|
|
|
|
|
|
|
|
|
|
@ -180,7 +180,7 @@ for module in sys.modules.values(): |
|
|
|
if sys.platform == 'darwin': |
|
|
|
try: |
|
|
|
import resource |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
pass |
|
|
|
else: |
|
|
|
soft, hard = resource.getrlimit(resource.RLIMIT_STACK) |
|
|
|
@ -567,7 +567,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, |
|
|
|
if findleaks: |
|
|
|
try: |
|
|
|
import gc |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
print('No GC available, disabling findleaks.') |
|
|
|
findleaks = False |
|
|
|
else: |
|
|
|
@ -688,7 +688,7 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, |
|
|
|
if use_mp: |
|
|
|
try: |
|
|
|
from threading import Thread |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
print("Multiprocess option requires thread support") |
|
|
|
sys.exit(2) |
|
|
|
from queue import Queue |
|
|
|
@ -1399,7 +1399,7 @@ def dash_R(the_module, test, indirect_test, huntrleaks): |
|
|
|
pic = sys.path_importer_cache.copy() |
|
|
|
try: |
|
|
|
import zipimport |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
zdc = None # Run unmodified on platforms without zipimport support |
|
|
|
else: |
|
|
|
zdc = zipimport._zip_directory_cache.copy() |
|
|
|
@ -1476,7 +1476,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): |
|
|
|
sys.path_importer_cache.update(pic) |
|
|
|
try: |
|
|
|
import zipimport |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
pass # Run unmodified on platforms without zipimport support |
|
|
|
else: |
|
|
|
zipimport._zip_directory_cache.clear() |
|
|
|
@ -1513,7 +1513,7 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs): |
|
|
|
doctest.master = None |
|
|
|
try: |
|
|
|
import ctypes |
|
|
|
except ModuleNotFoundError: |
|
|
|
except ImportError: |
|
|
|
# Don't worry about resetting the cache if ctypes is not supported |
|
|
|
pass |
|
|
|
else: |
|
|
|
|