summaryrefslogtreecommitdiffstats
path: root/Python/dynload_aix.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-01-29 16:15:36 (GMT)
committerGitHub <noreply@github.com>2020-01-29 16:15:36 (GMT)
commit696d2324cf2a54e20e8d6a6739fa97ba815a8be9 (patch)
tree0be4b1754264234f0a1bf8a3e02d8c4e9b6643d8 /Python/dynload_aix.c
parent2b675f0c8fd96f61977f6dc636f44fbd5587b6b3 (diff)
downloadcpython-696d2324cf2a54e20e8d6a6739fa97ba815a8be9.zip
cpython-696d2324cf2a54e20e8d6a6739fa97ba815a8be9.tar.gz
cpython-696d2324cf2a54e20e8d6a6739fa97ba815a8be9.tar.bz2
bpo-39485: fix corner-case in method-detection of mock (GH-18255)
Replace check for whether something is a method in the mock module. The previous version fails on PyPy, because there no method wrappers exist (everything looks like a regular Python-defined function). Thus the isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check returns True for any descriptor, not just methods. This condition could also return erroneously True in CPython for C-defined descriptors. Instead to decide whether something is a method, just check directly whether it's a function defined on the class. This passes all tests on CPython and fixes the bug on PyPy. (cherry picked from commit a327677905956ae0b239ff430a1346dfe265709e) Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de> Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
Diffstat (limited to 'Python/dynload_aix.c')
0 files changed, 0 insertions, 0 deletions