Git Product home page Git Product logo

Comments (6)

pylint-bot avatar pylint-bot commented on June 23, 2024

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


Does this replicate with Astroid 1.2?

from astroid.

pylint-bot avatar pylint-bot commented on June 23, 2024

Original comment by Brian Lane (BitBucket: bcl, GitHub: @bcl?):


I don't have any way to check, but from looking at the current code in astroid I don't see _type set on Module and the _is_metaclass code looks the same. Are there other changes that may prevent it from getting that far?

from astroid.

pylint-bot avatar pylint-bot commented on June 23, 2024

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


Well, only Class nodes should be processed by _is_metaclass. Could you provide a small sample that reproduces the code?

from astroid.

pylint-bot avatar pylint-bot commented on June 23, 2024

Original comment by Andrew Kuchev (BitBucket: 4soon):


I have similar problem when checking the following code:

#!python

def decor(f):
    return f


class Foo:
    @decor
    def prop(self):
        pass


if __name__ == '__main__':
    f = Foo()
    f.prop = 42

The stacktrace is:

#!python

$ pylint main.py
No config file found, using default configuration
************* Module main
C: 13, 0: Final newline missing (missing-final-newline)
C:  1, 0: Missing module docstring (missing-docstring)
W:  1,10: Redefining name 'f' from outer scope (line 12) (redefined-outer-name)
C:  1, 0: Invalid argument name "f" (invalid-name)
C:  1, 0: Missing function docstring (missing-docstring)
C:  5, 0: Missing class docstring (missing-docstring)
W:  5, 0: Class has no __init__ method (no-init)
C:  7, 4: Missing method docstring (missing-docstring)
Traceback (most recent call last):
  File "/usr/bin/pylint", line 9, in <module>
    load_entry_point('pylint==1.3.0', 'console_scripts', 'pylint')()
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/__init__.py", line 21, in run_pylint
    Run(sys.argv[1:])
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/lint.py", line 991, in __init__
    linter.check(args)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/lint.py", line 585, in check
    self.check_astroid_module(astroid, walker, rawcheckers, tokencheckers)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/lint.py", line 662, in check_astroid_module
    walker.walk(astroid)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/utils.py", line 804, in walk
    self.walk(child)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/utils.py", line 801, in walk
    cb(astroid)
  File "/usr/lib/python3.4/site-packages/pylint-1.3.0-py3.4.egg/pylint/checkers/classes.py", line 347, in visit_function
    if overridden_frame.type == 'method':
AttributeError: 'Module' object has no attribute 'type'

Version:

$ pylint --version
No config file found, using default configuration
pylint 1.3.0, 
astroid 1.2.0, common 0.62.1
Python 3.4.1 (default, May 19 2014, 17:23:49) 
[GCC 4.9.0 20140507 (prerelease)]

from astroid.

pylint-bot avatar pylint-bot commented on June 23, 2024

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


Thanks, Andrew, I fixed that in https://bitbucket.org/logilab/pylint/commits/e9ae6b39983942a2d47b2725458aca988ebd93ff. Unfortunately, it's not the same as the other failure.

from astroid.

pylint-bot avatar pylint-bot commented on June 23, 2024

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


Since there's no way to reproduce this, I'll close the issue in the mean time.

from astroid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.