Hello

And another bug report. The following cut-down version of a larger
script raises “AttributeError: 'Subscript' object has no attribute
'infer_lhs'” 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.

------------------------------------------------
class MyClass:
  def MyFunc(self):
    result['value'] -= min(result['value'],
                           sum([row[2] for row in xyz]))
------------------------------------------------

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 203, in wrapped
    for res in _func(node, context, **kwargs):
  File "…/logilab_astng-0.19.3-py2.5.egg/logilab/astng/inference.py",
line 398, in infer_augassign
    for lhs in self.target.infer_lhs(context):
AttributeError: 'Subscript' object has no attribute 'infer_lhs'
_______________________________________________
Python-Projects mailing list
Python-Projects@lists.logilab.org
http://lists.logilab.org/mailman/listinfo/python-projects

Reply via email to