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

PyCQA / astroid / 1572 / 7
91%
main: 92%

Build:
Build:
LAST BUILD BRANCH: regex-brain
DEFAULT BRANCH: main
Ran 08 Nov 2019 05:45PM UTC
Files 71
Run time 6s
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

08 Nov 2019 05:42PM UTC coverage: 89.983%. Remained the same
TOXENV=py38

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

7555 of 8396 relevant lines covered (89.98%)

0.9 hits per line

Source Files on job 1572.7 (TOXENV=py38)
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1146
  • Travis Job 1572.7
  • 20a7ae5d on github
  • Prev Job for TOXENV=py38 on master (#1571.7)
  • Next Job for TOXENV=py38 on master (#1573.7)
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