diff options
author | Xtreak <tir.karthi@gmail.com> | 2019-04-13 19:12:33 (GMT) |
---|---|---|
committer | Pablo Galindo <Pablogsal@gmail.com> | 2019-04-13 19:12:33 (GMT) |
commit | 830b43d03cc47a27a22a50d777f23c8e60820867 (patch) | |
tree | ebc93ae27d63c221fecc28a0b67d504563f8ec40 /Misc | |
parent | fde9b33dfeedd4a4ed723b12d2330979dc684760 (diff) | |
download | cpython-830b43d03cc47a27a22a50d777f23c8e60820867.zip cpython-830b43d03cc47a27a22a50d777f23c8e60820867.tar.gz cpython-830b43d03cc47a27a22a50d777f23c8e60820867.tar.bz2 |
bpo-36593: Fix isinstance check for Mock objects with spec executed under tracing (GH-12790)
In Python having a trace function in effect while mock is imported causes isinstance to be wrong for MagicMocks. This is due to the usage of super() in some class methods, as this sets the __class__ attribute. To avoid this, as a workaround, alias the usage of super .
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-04-11-22-11-24.bpo-36598.hfzDUl.rst | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-04-11-22-11-24.bpo-36598.hfzDUl.rst b/Misc/NEWS.d/next/Library/2019-04-11-22-11-24.bpo-36598.hfzDUl.rst new file mode 100644 index 0000000..2a79802 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-04-11-22-11-24.bpo-36598.hfzDUl.rst @@ -0,0 +1,2 @@ +Fix ``isinstance`` check for Mock objects with spec when the code is +executed under tracing. Patch by Karthikeyan Singaravelan. |