pypy in imp module no support attribute IMP_HOOK type
pypy bug issue: (#1387) https://bugs.pypy.org/issue1387
>>>> from py2exe.mf import ModuleFinder
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "E:\pypy-2.0-beta1\site-packages\py2exe\mf.py", line 801, in <module>
imp.IMP_HOOK: "IMP_HOOK",
AttributeError: 'module' object has no attribute 'IMP_HOOK'
Confirm python2.7.3:
>>>> import imp
>>>> help(imp)
DATA
C_BUILTIN = 6
C_EXTENSION = 3
IMP_HOOK = 9 <-- here!
PKG_DIRECTORY = 5
PY_CODERESOURCE = 8
PY_COMPILED = 2
PY_FROZEN = 7
PY_RESOURCE = 4
PY_SOURCE = 1
SEARCH_ERROR = 0
Confirmed pypy here not see IMP_HOOK
>>>> import imp
>>>> help(imp)
Help on built-in module imp:
...
DATA
C_BUILTIN = 6
C_EXTENSION = 3
PKG_DIRECTORY = 5
PY_COMPILED = 2
PY_FROZEN = 7
PY_SOURCE = 1
In Python-2.7 source code importdl.h can see IMP_HOOK declared:
enum filetype {
SEARCH_ERROR,
PY_SOURCE,
PY_COMPILED,
C_EXTENSION,
PY_RESOURCE, /* Mac only */
PKG_DIRECTORY,
C_BUILTIN,
PY_FROZEN,
PY_CODERESOURCE, /* Mac only */
IMP_HOOK
};
>>>> from py2exe.mf import ModuleFinder
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "E:\pypy-2.0-beta1\site-packages\py2exe\mf.py", line 801, in <module>
imp.IMP_HOOK: "IMP_HOOK",
AttributeError: 'module' object has no attribute 'IMP_HOOK'
Confirm python2.7.3:
>>>> import imp
>>>> help(imp)
DATA
C_BUILTIN = 6
C_EXTENSION = 3
IMP_HOOK = 9 <-- here!
PKG_DIRECTORY = 5
PY_CODERESOURCE = 8
PY_COMPILED = 2
PY_FROZEN = 7
PY_RESOURCE = 4
PY_SOURCE = 1
SEARCH_ERROR = 0
Confirmed pypy here not see IMP_HOOK
>>>> import imp
>>>> help(imp)
Help on built-in module imp:
...
DATA
C_BUILTIN = 6
C_EXTENSION = 3
PKG_DIRECTORY = 5
PY_COMPILED = 2
PY_FROZEN = 7
PY_SOURCE = 1
In Python-2.7 source code importdl.h can see IMP_HOOK declared:
enum filetype {
SEARCH_ERROR,
PY_SOURCE,
PY_COMPILED,
C_EXTENSION,
PY_RESOURCE, /* Mac only */
PKG_DIRECTORY,
C_BUILTIN,
PY_FROZEN,
PY_CODERESOURCE, /* Mac only */
IMP_HOOK
};
Comments
Post a Comment