Commits

Ronny Pfannschmidt  committed 342497b

kill import_from_lib_pypy

this removes the fragile use of import_from_lib_pypy
with actual imports to lib_pypy since its actually a package
and can be used that way

  • Participants
  • Parent commits fa3ef08
  • Branches kill-import_from_lib_pypy

Comments (0)

Files changed (4)

File pypy/tool/compat.py

     except ImportError:
         # no _md5 module on this platform. Try hard to find a pure-python one
         # by fishing it from lib_pypy
-        from pypy.tool.lib_pypy import import_from_lib_pypy
-        md5 = import_from_lib_pypy('md5')
-        del import_from_lib_pypy
+        from lib_pypy._md5 import new as md5

File pypy/tool/lib_pypy.py

 LIB_ROOT = py.path.local(pypy.__path__[0]).dirpath()
 LIB_PYPY =  LIB_ROOT.join('lib_pypy')
 LIB_PYTHON = LIB_ROOT.join('lib-python', '%d.%d' % CPYTHON_VERSION[:2])
-
-
-def import_from_lib_pypy(modname):
-    modname = LIB_PYPY.join(modname+'.py')
-    return modname.pyimport()

File pypy/tool/test/test_lib_pypy.py

 
 def test_lib_python_exists():
     assert lib_pypy.LIB_PYTHON.check(dir=1)
-
-def test_import_from_lib_pypy():
-    _functools = lib_pypy.import_from_lib_pypy('_functools')
-    assert type(_functools) is type(lib_pypy)
-    assert _functools.__name__ == 'lib_pypy._functools'
-    assert hasattr(_functools, 'partial')

File pypy/translator/goal/targetpypystandalone.py

         return PyPyJitPolicy(pypy_hooks)
     
     def get_entry_point(self, config):
-        from pypy.tool.lib_pypy import import_from_lib_pypy
-        rebuild = import_from_lib_pypy('ctypes_config_cache/rebuild')
-        rebuild.try_rebuild()
+        from lib_pypy.ctypes_config_cache.rebuild import try_rebuild
+        try_rebuild()
 
         space = make_objspace(config)