2009-02-06 22:33:52 -04:00
|
|
|
import imp
|
2012-05-11 13:58:42 -03:00
|
|
|
from importlib import machinery
|
2009-02-06 22:33:52 -04:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
PATH = None
|
|
|
|
EXT = None
|
|
|
|
FILENAME = None
|
|
|
|
NAME = '_testcapi'
|
|
|
|
try:
|
|
|
|
for PATH in sys.path:
|
2012-05-11 13:58:42 -03:00
|
|
|
for EXT in machinery.EXTENSION_SUFFIXES:
|
2009-02-06 22:33:52 -04:00
|
|
|
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
|