mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Fix test_pep352 to deal with the removal of the 'exceptions' module.
This commit is contained in:
parent
4fc8ae424f
commit
4af7dcf10d
1 changed files with 8 additions and 2 deletions
|
|
@ -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 @@ def verify_instance_interface(self, ins):
|
|||
|
||||
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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue