[pypy-issue] [issue1387] imp module no attribute IMP_HOOK type

yongjie tracker at bugs.pypy.org
Mon Feb 4 04:19:19 CET 2013


New submission from yongjie <yongjie989 at gmail.com>:

>>>> 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
};

----------
messages: 5249
nosy: pypy-issue
priority: bug
release: 2.0
status: unread
title: imp module no attribute IMP_HOOK type

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1387>
________________________________________


More information about the pypy-issue mailing list