File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1
1
BaseException
2
2
+-- SystemExit
3
+ +-- TaskletExit
3
4
+-- KeyboardInterrupt
4
5
+-- GeneratorExit
5
6
+-- Exception
Original file line number Diff line number Diff line change @@ -45,6 +45,12 @@ def test_inheritance(self):
45
45
exc_set = set (x for x in dir (exceptions ) if not x .startswith ('_' ))
46
46
inheritance_tree = open (os .path .join (os .path .split (__file__ )[0 ],
47
47
'exception_hierarchy.txt' ))
48
+ haveStackless = False
49
+ try :
50
+ import stackless
51
+ haveStackless = True
52
+ except ImportError :
53
+ pass
48
54
try :
49
55
superclass_name = inheritance_tree .readline ().rstrip ()
50
56
try :
@@ -72,6 +78,8 @@ def test_inheritance(self):
72
78
try :
73
79
exc = getattr (__builtin__ , exc_name )
74
80
except AttributeError :
81
+ if exc_name == "TaskletExit" and not haveStackless :
82
+ continue
75
83
self .fail ("%s not a built-in exception" % exc_name )
76
84
if last_depth < depth :
77
85
superclasses .append ((last_depth , last_exc ))
Original file line number Diff line number Diff line change @@ -598,7 +598,8 @@ def method():
598
598
import __builtin__
599
599
check (__builtin__ .file .closed , size (h + '2PP' ))
600
600
# wrapper_descriptor (descriptor object)
601
- check (int .__add__ , size (h + '2P2P' ))
601
+ slpmask = "i" if haveStackless else ""
602
+ check (int .__add__ , size (h + '2P2P' + slpmask ))
602
603
# dictproxy
603
604
class C (object ): pass
604
605
check (C .__dict__ , size (h + 'P' ))
You can’t perform that action at this time.
0 commit comments