Commits

Armin Rigo committed 1c71316

Like CPython, the built-in module should be "_struct", imported
by the file "lib-python/2.7/struct.py". Fixes a very obscure
ImportError by running "-m idlelib.idle".

Comments (0)

Files changed (2)

pypy/module/struct/__init__.py

 
 The variable struct.error is an exception raised on errors."""
 
+    applevel_name = "_struct"
+
     interpleveldefs = {
         'error': 'interp_struct.get_error(space)',
 
         'unpack_from': 'interp_struct.unpack_from',
 
         'Struct': 'interp_struct.W_Struct',
+        '_clearcache': 'interp_struct.clearcache',
     }
 
     appleveldefs = {

pypy/module/struct/interp_struct.py

     pack_into=interp2app(W_Struct.descr_pack_into),
     unpack_from=interp2app(W_Struct.descr_unpack_from),
 )
+
+def clearcache(space):
+    """No-op on PyPy"""