• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PyCQA / astroid / 1572
91%
main: 92%

Build:
Build:
LAST BUILD BRANCH: regex-brain
DEFAULT BRANCH: main
Ran 08 Nov 2019 05:44PM UTC
Jobs 5
Files 284
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
1572

push

travis-ci

PCManticore
Don't set a parent for descriptor bound methods created on `__get__` access

This is a very tricky bug and requires particular circumstances to reproduce.
For `f.__get__` we have a custom binding interface that generates bound
methods on the fly whenever we encounter an `f.__get__(None, ...)` call.
On function creation, we set the name of the function as a variable in
the frame of the function's parent. e.g. for the following, we'll set
`variable` as a name in the function's locals:

   class A:
       ...
      def variable(self):  # variable will be part of A.locals
          pass

Now the bug that this commit solves requires a `__get__()` binding such
as the one mentioned as well as passing an object's dunder attribute
to `__get__`, such as `object.__eq__`. The result is that the `None`
 that was passed in `f.__get__` will have as a frame the function where
the descriptor binding method was called, which will result in `__eq__`
to be marked as a variable of the function that was called, which is
completely wrong.

As a solution we don't set any parent for descriptor bound methods,
which are created on the fly and thus the parent might be wrong altogether.

Close PyCQA/pylint#3225

29755 of 33142 relevant lines covered (89.78%)

4.45 hits per line

Jobs
ID Job ID Ran Files Coverage
3 1572.3 (TOXENV=py35) 08 Nov 2019 05:44PM UTC 0
88.23
Travis Job 1572.3
4 1572.4 (TOXENV=pypy) 08 Nov 2019 05:45PM UTC 0
87.74
Travis Job 1572.4
5 1572.5 (TOXENV=py36) 08 Nov 2019 05:46PM UTC 0
89.57
Travis Job 1572.5
6 1572.6 (TOXENV=py37) 08 Nov 2019 05:46PM UTC 0
89.51
Travis Job 1572.6
7 1572.7 (TOXENV=py38) 08 Nov 2019 05:45PM UTC 0
89.98
Travis Job 1572.7
Source Files on build 1572
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #1572
  • 20a7ae5d on github
  • Prev Build on master (#1571)
  • Next Build on master (#1573)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc