Message3914
We only needed to support builtin modules in find_module, not other
things (like meta_path), so this was actually a fairly easy fix -- r5735
With this change pylint gets farther, but I ran into 3 more issues:
File "/Users/pjenvey/src/java/jython/jython-pylons2/Lib/site-
packages/logilab.pylintinstaller-0.15.2-
py2.5.egg/logilab/astng/builder.py", line 34, in <module>
from parser import ParserError
ImportError: No module named parser
Which is an unused import that can be safely removed
File "/Users/pjenvey/src/java/jython/jython-pylons2/Lib/site-
packages/pylint-0.15.2-py2.5.egg/pylint/checkers/utils.py", line 77, in
<module>
builtins = __builtins__.copy()
__builtins__ is a CPython implementation detail that pylint/logilab
references a few times. You'll want to import the __builtin__ module and
use that instead
The final issue is probably more dire, in that logilab.astng seems to be
a heavy user of the compiler module. Jython doesn't support it and never
will, because a) it generates .pyc bytecode that we don't use b) it
heavily relies on the parser module which we will never support either
c) is pending deprecation and was removed in Python 3
The parser module provides the low level innards of CPython's parser
(which is really nothing like ours), and the way to deal with AST going
forward is via the _ast module, which we support and was originally
added in CPython 2.5. We also support the ast module, as well as the
ability to pass modified/generated AST to the compile function, which
were both added in CPython 2.6.
So migrating away from the compiler module will benefit pylint on Jython
2.5 as well as Python 3
$ pylint b.py
No config file found, using default configuration
Traceback (most recent call last):
File "/Users/pjenvey/src/java/jython/jython-pylons2/Lib/site-
packages/logilab.pylintinstaller-0.15.2-
py2.5.egg/logilab/astng/manager.py", line 110, in astng_from_file
astng = ASTNGBuilder(self).file_build(filepath, modname)
File "/Users/pjenvey/src/java/jython/jython-pylons2/Lib/site-
packages/logilab.pylintinstaller-0.15.2-
py2.5.egg/logilab/astng/builder.py", line 219, in file_build
node = self.string_build(data, modname, path)
File "/Users/pjenvey/src/java/jython/jython-pylons2/Lib/site-
packages/logilab.pylintinstaller-0.15.2-
py2.5.egg/logilab/astng/builder.py", line 229, in string_build
return self.ast_build(parse(data + '\n'), modname, path)
File
"/Users/pjenvey/src/java/jython/dist/Lib/compiler/transformer.py", line
51, in parse
return Transformer().parsesuite(buf)
File
"/Users/pjenvey/src/java/jython/dist/Lib/compiler/transformer.py", line
121, in parsesuite
return self.transform(parser.suite(text))
AttributeError: 'NoneType' object has no attribute 'suite'
************* Module b
F: 1: <class 'logilab.astng._exceptions.ASTNGBuildingException'>:
Unable to load module b ('NoneType' object has no attribute 'suite') |
|
Date |
User |
Action |
Args |
2008-12-11 05:38:46 | pjenvey | set | messageid: <1228973926.44.0.317724963399.issue1161@psf.upfronthosting.co.za> |
2008-12-11 05:38:46 | pjenvey | set | recipients:
+ pjenvey, sreimers |
2008-12-11 05:38:44 | pjenvey | link | issue1161 messages |
2008-12-11 05:38:11 | pjenvey | create | |
|