summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/copy_reg.py5
-rw-r--r--Lib/distutils/sysconfig.py2
-rw-r--r--Lib/encodings/__init__.py3
-rw-r--r--Lib/test/test_opcodes.py8
4 files changed, 7 insertions, 11 deletions
diff --git a/Lib/copy_reg.py b/Lib/copy_reg.py
index f499013..169520d 100644
--- a/Lib/copy_reg.py
+++ b/Lib/copy_reg.py
@@ -4,17 +4,12 @@ This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
-from types import ClassType as _ClassType
-
__all__ = ["pickle", "constructor",
"add_extension", "remove_extension", "clear_extension_cache"]
dispatch_table = {}
def pickle(ob_type, pickle_function, constructor_ob=None):
- if type(ob_type) is _ClassType:
- raise TypeError("copy_reg is not intended for use with classes")
-
if not callable(pickle_function):
raise TypeError("reduction functions must be callable")
dispatch_table[ob_type] = pickle_function
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 9bdbb16..dc603be 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -16,7 +16,7 @@ import re
import string
import sys
-from errors import DistutilsPlatformError
+from .errors import DistutilsPlatformError
# These are needed in a couple of spots, so just compute them once.
PREFIX = os.path.normpath(sys.prefix)
diff --git a/Lib/encodings/__init__.py b/Lib/encodings/__init__.py
index 01463bc..ddaacb9 100644
--- a/Lib/encodings/__init__.py
+++ b/Lib/encodings/__init__.py
@@ -27,7 +27,8 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
"""#"
-import codecs, types, aliases
+import codecs, types
+from . import aliases
_cache = {}
_unknown = '--unknown--'
diff --git a/Lib/test/test_opcodes.py b/Lib/test/test_opcodes.py
index c192963..742267f 100644
--- a/Lib/test/test_opcodes.py
+++ b/Lib/test/test_opcodes.py
@@ -25,9 +25,9 @@ if n != 90:
print '2.2 raise class exceptions'
-class AClass: pass
+class AClass(Exception): pass
class BClass(AClass): pass
-class CClass: pass
+class CClass(Exception): pass
class DClass(AClass):
def __init__(self, ignore):
pass
@@ -58,8 +58,8 @@ except AClass, v:
if v != b: raise TestFailed, "v!=b AClass"
# not enough arguments
-try: raise BClass, a
-except TypeError: pass
+##try: raise BClass, a
+##except TypeError: pass
try: raise DClass, a
except DClass, v: