File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -348,12 +348,20 @@ def testExceptionIsInstanceOfSystemObject(self):
348348 # without causing a crash in the CPython interpreter). This test is
349349 # here mainly to remind me to update the caveat in the documentation
350350 # one day when when exceptions can be new-style classes.
351+
352+ # This behaviour is now over-shadowed by the implementation of
353+ # __instancecheck__ (i.e., overloading isinstance), so for all Python
354+ # version >= 2.6 we expect isinstance(<managed exception>, Object) to
355+ # be true, even though it does not really subclass Object.
351356 from System import OverflowException
352357 from System import Object
353358
354359 o = OverflowException ('error' )
355- self .assertFalse (isinstance (o , Object ))
356-
360+
361+ if sys .version_info >= (2 , 6 ):
362+ self .assertTrue (isinstance (o , Object ))
363+ else :
364+ self .assertFalse (isinstance (o , Object ))
357365
358366
359367def test_suite ():
You can’t perform that action at this time.
0 commit comments