Hello
The following cut-down version of a larger script raises “KeyError:
'~'” in pyreverse. As in my previous bug report, this script wouldn't
work on its own, but it reproduces the error. A complete backtrace can
be found at the end of this e-mail.
------------------------------------------------
import pyparsing as pyp
class MyClass(MyBase):
def xyz(self):
rbrace = pyp.Literal("}").suppress()
stmt = (~rbrace + keyword + ~lbrace)
------------------------------------------------
Using pyreverse as included in the following pylint version:
$ pylint --version
pylint 0.19.0,
astng 0.19.3, common 0.46.0
Python 2.5.2
Thanks,
Michael
---
$ pyreverse test.py
parsing test.py...
Traceback (most recent call last):
File "/usr/bin/pyreverse", line 5, in <module>
pkg_resources.run_script('pylint==0.19.0', 'pyreverse')
File "…/pkg_resources.py", line 448, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "…/pkg_resources.py", line 1166, in run_script
execfile(script_filename, namespace, namespace)
File "…/pylint-0.19.0-py2.5.egg/EGG-INFO/scripts/pyreverse", line 4,
in <module>
main.Run(sys.argv[1:])
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/main.py", line 120,
in __init__
PyreverseCommand(args)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/main.py", line 99,
in __init__
self.run(args)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/main.py", line 109, in run
diadefs = handler.get_diadefs(project, linker)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/diadefslib.py",
line 225, in get_diadefs
diagrams = DefaultDiadefGenerator(linker, self).visit(project)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
353, in visit
self.visit(local_node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
353, in visit
self.visit(local_node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
347, in visit
methods[0](node)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/diadefslib.py",
line 167, in visit_class
self.extract_classes(node, anc_level, ass_level)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/diadefslib.py",
line 111, in extract_classes
self.add_class(klass_node)
File "…/pylint-0.19.0-py2.5.egg/pylint/pyreverse/diadefslib.py",
line 82, in add_class
self.linker.visit(node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
353, in visit
self.visit(local_node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
353, in visit
self.visit(local_node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/utils.py", line
347, in visit
methods[0](node)
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inspector.py",
line 177, in visit_assname
values = list(node.infer())
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py",
line 203, in wrapped
for res in _func(node, context, **kwargs):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py",
line 168, in _infer_stmts
for infered in stmt.infer(context):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py",
line 203, in wrapped
for res in _func(node, context, **kwargs):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py",
line 366, in infer_binop
for lhs in self.left.infer(context):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py",
line 203, in wrapped
for res in _func(node, context, **kwargs):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py",
line 366, in infer_binop
for lhs in self.left.infer(context):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/infutils.py",
line 203, in wrapped
for res in _func(node, context, **kwargs):
File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py",
line 315, in infer_unaryop
meth = UNARY_OP_METHOD[self.op]
KeyError: '~'
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects