diff options
author | Guido van Rossum <guido@python.org> | 2006-03-15 04:58:47 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-03-15 04:58:47 +0000 |
commit | 45aecf451a64fb1ebe5e74d0b00965ac8d99dff6 (patch) | |
tree | a7edcfb45ceafcffde68a3542aeba67089ea81cb /Lib | |
parent | f3175f6341ae207543a0d2d3be36c457349066e6 (diff) | |
download | cpython-git-45aecf451a64fb1ebe5e74d0b00965ac8d99dff6.tar.gz |
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
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/copy_reg.py | 5 | ||||
-rw-r--r-- | Lib/distutils/sysconfig.py | 2 | ||||
-rw-r--r-- | Lib/encodings/__init__.py | 3 | ||||
-rw-r--r-- | Lib/test/test_opcodes.py | 8 |
4 files changed, 7 insertions, 11 deletions
diff --git a/Lib/copy_reg.py b/Lib/copy_reg.py index f4990130fb..169520d1f6 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 9bdbb16a8c..dc603be8b7 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 01463bc34c..ddaacb9e3f 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 c1929637ac..742267f5f9 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: |