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):
348
348
# without causing a crash in the CPython interpreter). This test is
349
349
# here mainly to remind me to update the caveat in the documentation
350
350
# 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.
351
356
from System import OverflowException
352
357
from System import Object
353
358
354
359
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 ))
357
365
358
366
359
367
def test_suite ():
You can’t perform that action at this time.
0 commit comments