Commits

Amaury Forgeot d'Arc  committed 7a16ec7

We put _importlib.pypy.so in a weird place, help test_imporlib find it.

  • Participants
  • Parent commits 00e6e59
  • Branches py3k

Comments (0)

Files changed (1)

File lib-python/3.2/importlib/test/extension/util.py

             if os.path.exists(os.path.join(PATH, FILENAME)):
                 raise StopIteration
     else:
-        PATH = EXT = FILENAME = FILEPATH = None
+        # Try a direct import
+        try:
+            import _testcapi
+        except ImportError:
+            PATH = EXT = FILENAME = FILEPATH = None
+        else:
+            FILEPATH = _testcapi.__file__
+            PATH, FILENAME = os.path.split(FILEPATH)
+            _, EXT = os.path.splitext(FILEPATH)
 except StopIteration:
     pass
 del _file_exts