8000 Fix test in the regression testsuite to work for stackless. · stackless-dev/stackless_historic@3fb8677 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3fb8677

Browse files
author
kristjan.jonsson
committed
Fix test in the regression testsuite to work for stackless.
git-svn-id: http://svn.python.org/projects/stackless/trunk@82372 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent b6b8e9e commit 3fb8677

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Lib/test/exception_hierarchy.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
BaseException
22
+-- SystemExit
3+
+-- TaskletExit
34
+-- KeyboardInterrupt
45
+-- GeneratorExit
56
+-- Exception

Lib/test/test_pep352.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ def test_inheritance(self):
4545
exc_set = set(x for x in dir(exceptions) if not x.startswith('_'))
4646
inheritance_tree = open(os.path.join(os.path.split(__file__)[0],
4747
'exception_hierarchy.txt'))
48+
haveStackless = False
49+
try:
50+
import stackless
51+
haveStackless = True
52+
except ImportError:
53+
pass
4854
try:
4955
superclass_name = inheritance_tree.readline().rstrip()
5056
try:
@@ -72,6 +78,8 @@ def test_inheritance(self):
7278
try:
7379
exc = getattr(__builtin__, exc_name)
7480
except AttributeError:
81+
if exc_name == "TaskletExit" and not haveStackless:
82+
continue
7583
self.fail("%s not a built-in exception" % exc_name)
7684
if last_depth < depth:
7785
superclasses.append((last_depth, last_exc))

Lib/test/test_sys.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,8 @@ def method():
598598
import __builtin__
599599
check(__builtin__.file.closed, size(h + '2PP'))
600600
# 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))
602603
# dictproxy
603604
class C(object): pass
604605
check(C.__dict__, size(h + 'P'))

0 commit comments

Comments
 (0)
0