diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-26 22:22:47 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-02-26 22:22:47 (GMT) |
commit | 2633c69fae7e413b2b64b01d8c0c901ae649a225 (patch) | |
tree | 144a1f97f427f019a8ddaae96a8f0da6a09df985 /Lib | |
parent | f543348fff32ae20a9fd2c7f70a3549a3280048c (diff) | |
download | cpython-2633c69fae7e413b2b64b01d8c0c901ae649a225.zip cpython-2633c69fae7e413b2b64b01d8c0c901ae649a225.tar.gz cpython-2633c69fae7e413b2b64b01d8c0c901ae649a225.tar.bz2 |
Remove the exceptions builtin module, all the exceptions are already builtin.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/ctypes/test/test_structures.py | 8 | ||||
-rw-r--r-- | Lib/test/output/test_logging | 6 | ||||
-rw-r--r-- | Lib/test/test_exceptions.py | 11 | ||||
-rw-r--r-- | Lib/test/test_generators.py | 4 | ||||
-rw-r--r-- | Lib/test/test_modulefinder.py | 14 | ||||
-rw-r--r-- | Lib/test/test_weakref.py | 6 | ||||
-rw-r--r-- | Lib/traceback.py | 2 | ||||
-rw-r--r-- | Lib/weakref.py | 2 |
8 files changed, 21 insertions, 32 deletions
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py index 097e1da..389f937 100644 --- a/Lib/ctypes/test/test_structures.py +++ b/Lib/ctypes/test/test_structures.py @@ -294,20 +294,20 @@ class StructureTestCase(unittest.TestCase): # In Python 2.5, Exception is a new-style class, and the repr changed if issubclass(Exception, object): self.failUnlessEqual(msg, - "(Phone) <type 'exceptions.TypeError'>: " + "(Phone) <type 'TypeError'>: " "expected string or Unicode object, int found") else: self.failUnlessEqual(msg, - "(Phone) exceptions.TypeError: " + "(Phone) TypeError: " "expected string or Unicode object, int found") cls, msg = self.get_except(Person, "Someone", ("a", "b", "c")) self.failUnlessEqual(cls, RuntimeError) if issubclass(Exception, object): self.failUnlessEqual(msg, - "(Phone) <type 'exceptions.ValueError'>: too many initializers") + "(Phone) <type 'ValueError'>: too many initializers") else: - self.failUnlessEqual(msg, "(Phone) exceptions.ValueError: too many initializers") + self.failUnlessEqual(msg, "(Phone) ValueError: too many initializers") def get_except(self, func, *args): diff --git a/Lib/test/output/test_logging b/Lib/test/output/test_logging index c0d6e06..ebf40c5 100644 --- a/Lib/test/output/test_logging +++ b/Lib/test/output/test_logging @@ -488,12 +488,12 @@ INFO:a.b.c.d:Info 5 -- log_test4 begin --------------------------------------------------- config0: ok. config1: ok. -config2: <type 'exceptions.AttributeError'> -config3: <type 'exceptions.KeyError'> +config2: <type 'AttributeError'> +config3: <type 'KeyError'> -- log_test4 end --------------------------------------------------- -- log_test5 begin --------------------------------------------------- ERROR:root:just testing -<type 'exceptions.KeyError'>... Don't panic! +<type 'KeyError'>... Don't panic! -- log_test5 end --------------------------------------------------- -- logrecv output begin --------------------------------------------------- ERR -> CRITICAL: Message 0 (via logrecv.tcp.ERR) diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index 4891f4b..0ff3b10 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -15,15 +15,6 @@ from test.test_support import TESTFN, unlink, run_unittest class ExceptionTests(unittest.TestCase): - def testReload(self): - # Reloading the built-in exceptions module failed prior to Py2.2, while it - # should act the same as reloading built-in sys. - try: - import exceptions - reload(exceptions) - except ImportError as e: - self.fail("reloading exceptions: %s" % e) - def raise_catch(self, exc, excname): try: raise exc, "spam" @@ -289,7 +280,7 @@ class ExceptionTests(unittest.TestCase): if type(e) is not exc: raise # Verify module name - self.assertEquals(type(e).__module__, 'exceptions') + self.assertEquals(type(e).__module__, '__builtin__') # Verify no ref leaks in Exc_str() s = str(e) for checkArgName in expected: diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index edfcb65..7999034 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1691,7 +1691,7 @@ Our ill-behaved code should be invoked during GC: >>> g.next() >>> del g >>> sys.stderr.getvalue().startswith( -... "Exception exceptions.RuntimeError: 'generator ignored GeneratorExit' in " +... "Exception RuntimeError: 'generator ignored GeneratorExit' in " ... ) True >>> sys.stderr = old @@ -1808,7 +1808,7 @@ to test. ... del l ... err = sys.stderr.getvalue().strip() ... err.startswith( -... "Exception exceptions.RuntimeError: RuntimeError() in <" +... "Exception RuntimeError: RuntimeError() in <" ... ) ... err.endswith("> ignored") ... len(err.splitlines()) diff --git a/Lib/test/test_modulefinder.py b/Lib/test/test_modulefinder.py index 7da241b..3bc22ab 100644 --- a/Lib/test/test_modulefinder.py +++ b/Lib/test/test_modulefinder.py @@ -87,7 +87,7 @@ absolute_import_test = [ "a.module", ["a", "a.module", "b", "b.x", "b.y", "b.z", - "__future__", "sys", "exceptions"], + "__future__", "sys", "gc"], ["blahblah", "z"], [], """\ mymodule.py @@ -96,11 +96,11 @@ a/module.py from __future__ import absolute_import import sys # sys import blahblah # fails - import exceptions # exceptions + import gc # gc import b.x # b.x from b import y # b.y from b.z import * # b.z.* -a/exceptions.py +a/gc.py a/sys.py import mymodule a/b/__init__.py @@ -123,7 +123,7 @@ relative_import_test = [ "a.b.c", "a.b.c.moduleC", "a.b.c.d", "a.b.c.e", "a.b.x", - "exceptions"], + "gc"], [], [], """\ mymodule.py @@ -131,8 +131,8 @@ a/__init__.py from .b import y, z # a.b.y, a.b.z a/module.py from __future__ import absolute_import # __future__ - import exceptions # exceptions -a/exceptions.py + import gc # gc +a/gc.py a/sys.py a/b/__init__.py from ..b import x # a.b.x @@ -170,7 +170,7 @@ a/__init__.py a/another.py a/module.py from .b import y, z # a.b.y, a.b.z -a/exceptions.py +a/gc.py a/sys.py a/b/__init__.py from .c import moduleC # a.b.c.moduleC diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 642af10..46dd5ff 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -104,9 +104,9 @@ class ReferencesTestCase(TestBase): def check(proxy): proxy.bar - self.assertRaises(weakref.ReferenceError, check, ref1) - self.assertRaises(weakref.ReferenceError, check, ref2) - self.assertRaises(weakref.ReferenceError, bool, weakref.proxy(C())) + self.assertRaises(ReferenceError, check, ref1) + self.assertRaises(ReferenceError, check, ref2) + self.assertRaises(ReferenceError, bool, weakref.proxy(C())) self.assert_(self.cbcalled == 2) def check_basic_ref(self, factory): diff --git a/Lib/traceback.py b/Lib/traceback.py index e395ad7..a0d2dcc 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -169,7 +169,7 @@ def format_exception_only(etype, value): stype = etype.__name__ smod = etype.__module__ - if smod not in ("exceptions", "__main__", "__builtin__"): + if smod not in ("__main__", "__builtin__"): stype = smod + '.' + stype if not issubclass(etype, SyntaxError): diff --git a/Lib/weakref.py b/Lib/weakref.py index c20d1b6..33896f5 100644 --- a/Lib/weakref.py +++ b/Lib/weakref.py @@ -20,8 +20,6 @@ from _weakref import ( ProxyType, ReferenceType) -from exceptions import ReferenceError - ProxyTypes = (ProxyType, CallableProxyType) |