Issue2352

classification
Title: Support C_BUILTIN in _imp.load_module
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: jeff.allen, zyasoft
Priority: normal Keywords:

Created on 2015-05-10.15:59:48 by jeff.allen, last changed 2015-05-11.02:57:37 by zyasoft.

Messages
msg10043 (view) Author: Jeff Allen (jeff.allen) Date: 2015-05-10.15:59:47
_imp.find_module returns, for a Java built-in module, a type of C_BUILTIN (=6), but _imp.load_module is then unable to load it, claiming it does not exist.

>>> import sys, imp
>>> file, filename, descr = imp.find_module("_marshal")
>>> descr
('', '', 6)
>>> imp.load_module("_marshal", file, filename, descr)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named _marshal
>>> import _marshal
>>> sys.modules['_marshal']
<type '_marshal'>

With this and #1906 we could revert to the CPython version of test_importhooks.
msg10044 (view) Author: Jim Baker (zyasoft) Date: 2015-05-11.02:57:37
+1, makes sense.
History
Date User Action Args
2015-05-11 02:57:37zyasoftsetnosy: + zyasoft
messages: + msg10044
2015-05-10 15:59:48jeff.allencreate