mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
Issue #15168: Move importlb.test to test.test_importlib.
This should make the Linux distros happy as it is now easier to leave importlib's tests out of their base Python distribution.
This commit is contained in:
parent
4afc1c08d0
commit
45a5e3afe5
43 changed files with 33 additions and 38 deletions
20
Lib/test/test_importlib/extension/util.py
Normal file
20
Lib/test/test_importlib/extension/util.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import imp
|
||||
from importlib import machinery
|
||||
import os
|
||||
import sys
|
||||
|
||||
PATH = None
|
||||
EXT = None
|
||||
FILENAME = None
|
||||
NAME = '_testcapi'
|
||||
try:
|
||||
for PATH in sys.path:
|
||||
for EXT in machinery.EXTENSION_SUFFIXES:
|
||||
FILENAME = NAME + EXT
|
||||
FILEPATH = os.path.join(PATH, FILENAME)
|
||||
if os.path.exists(os.path.join(PATH, FILENAME)):
|
||||
raise StopIteration
|
||||
else:
|
||||
PATH = EXT = FILENAME = FILEPATH = None
|
||||
except StopIteration:
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue