summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-02-28 00:01:43 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-02-28 00:01:43 (GMT)
commit4af7dcf10d7fa0aa116e283ad8212ed8aac8eea0 (patch)
tree1f8469ffa978a1d63d6f15843e3a8602e7075df1 /Lib/test
parent4fc8ae424f915d07ff56d32dceec3d2c4a89560e (diff)
downloadcpython-4af7dcf10d7fa0aa116e283ad8212ed8aac8eea0.zip
cpython-4af7dcf10d7fa0aa116e283ad8212ed8aac8eea0.tar.gz
cpython-4af7dcf10d7fa0aa116e283ad8212ed8aac8eea0.tar.bz2
Fix test_pep352 to deal with the removal of the 'exceptions' module.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pep352.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py
index 1f72ead..5cfefd0 100644
--- a/Lib/test/test_pep352.py
+++ b/Lib/test/test_pep352.py
@@ -1,6 +1,5 @@
import unittest
import __builtin__
-import exceptions
import warnings
from test.test_support import run_unittest, guard_warnings_filter
import os
@@ -21,7 +20,14 @@ class ExceptionClassTests(unittest.TestCase):
def test_inheritance(self):
# Make sure the inheritance hierarchy matches the documentation
- exc_set = set(x for x in dir(exceptions) if not x.startswith('_'))
+ exc_set = set()
+ for object_ in __builtins__.__dict__.values():
+ try:
+ if issubclass(object_, BaseException):
+ exc_set.add(object_.__name__)
+ except TypeError:
+ pass
+
inheritance_tree = open(os.path.join(os.path.split(__file__)[0],
'exception_hierarchy.txt'))
try: