[issue1574217] isinstance swallows exceptions

Tres Seaver report at bugs.python.org
Thu Apr 29 00:13:27 CEST 2010


Tres Seaver <tseaver at agendaless.com> added the comment:

I can confirm that the patch applies cleanly to the 2.6 branch, that the new test fails before rebuilding, and that the test passes afterwards:

 $ hg summary
 parent: 41597:295c02a21979 tip
  [svn r80597] Merged revisions 80596 via svnmerge from
 branch: release26-maint
 commit: (clean)
 update: (current)
 $ ./configure && make
 ...
 $ ./python -E -tt Lib/test/regrtest.py test_isinstance
 test_isinstance
 1 test OK.
 $ patch -p1 < /tmp/issue1574217_dont_mask_errors.patch
 patching file Lib/test/test_isinstance.py
 patching file Objects/abstract.c
 Hunk #1 succeeded at 2854 (offset 619 lines).
 Hunk #2 succeeded at 2878 (offset 600 lines).
 test_isinstance
 test test_isinstance failed -- Traceback (most recent call last):
   File "/home/tseaver/projects/hg-repo/issue1574217/Lib/test/test_isinstance.py", line 94, in test_isinstance_dont_mask_non_attribute_error
    self.assertRaises(RuntimeError, isinstance, c, bool)
 AssertionError: RuntimeError not raised
 
 1 test failed:
     test_isinstance
 $ make
 ...
 $ ./python -E -tt Lib/test/regrtest.py test_isinstance
 test_isinstance
 1 test OK.

----------
nosy: +tseaver

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1574217>
_______________________________________


More information about the Python-bugs-list mailing list