pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.31k stars 1.13k forks source link

AttributeError: 'Name' object has no attribute 'expr' #368

Closed pylint-bot closed 8 years ago

pylint-bot commented 10 years ago

Originally reported by: Anonymous


Pylint throws an exception on the attached file.

#!python

Traceback (most recent call last):
  File "/Users/fermigier/envs/core/bin/pylint", line 9, in <module>
    load_entry_point('pylint==1.3.1', 'console_scripts', 'pylint')()
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/__init__.py", line 21, in run_pylint
    Run(sys.argv[1:])
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/lint.py", line 991, in __init__
    linter.check(args)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/lint.py", line 585, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/lint.py", line 662, in check_astroid_module
    walker.walk(astroid)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/utils.py", line 801, in walk
    cb(astroid)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/checkers/strings.py", line 339, in visit_callfunc
    self._check_new_format(node, func)
  File "/Users/fermigier/envs/core/lib/python2.7/site-packages/pylint/checkers/strings.py", line 348, in _check_new_format
    if not isinstance(node.func.expr, astroid.Const):
AttributeError: 'Name' object has no attribute 'expr'

pylint-bot commented 10 years ago

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


This is actually fixed in the tip and the fix will be part of Pylint 1.4.