Commits

mattip committed 91a022d

add enough hacks so that 'import numpy' fails for non-trivial reasons

Comments (0)

Files changed (2)

lib_pypy/numpy/__init__.py

         loader = PackageLoader(infunc=True)
         return loader(*packages, **options)
 
+    import numpypy
+
     import add_newdocs
     __all__ = ['add_newdocs']
 
     from testing import Tester
     test = Tester().test
     bench = Tester().bench
-
+    
     import core
     from core import *
     import compat

lib_pypy/numpypy/__init__.py

-from _numpypy import *
-from .core import *
+#from _numpypy import *
+#from .core import *
 
-import sys
-sys.modules.setdefault('numpy', sys.modules['numpypy'])
+import sys, types
+#sys.modules.setdefault('numpy', sys.modules['numpypy'])
+
+nt = types.ModuleType('numerictype','fake numerictypes module')
+setattr(nt, 'sctypeDict',{})
+import _numpypy as umath
+import multiarray
+sys.modules['numpy.core.multiarray'] = multiarray
+sys.modules['numpy.core.umath'] = umath
+
+sys.modules['numerictypes'] = nt
+sys.modules['numpy.core.numerictypes'] = nt