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:
Brett Cannon 2012-07-20 14:48:53 -04:00
parent 4afc1c08d0
commit 45a5e3afe5
43 changed files with 33 additions and 38 deletions

View 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