Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done)
- int/int -> float
- all exceptions must derive from BaseException
- absolute import
- 'as' and 'with' are keywords
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 @@
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 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 @@
"""#"
-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 @@
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 @@
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: