summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-04-02 23:55:37 +0000
committerGuido van Rossum <guido@python.org>2007-04-02 23:55:37 +0000
commitab8802a4f75336ef9c65c5958c480609c5c92fb3 (patch)
treebcebdb66a1746228365deb9496a633a8970711da
parent01a807db2a4b2d39d8e9473e658b908ff58e1058 (diff)
downloadcpython-git-ab8802a4f75336ef9c65c5958c480609c5c92fb3.tar.gz
Fix warnings about object.__init__() signature.
Two (test_array and test_descr) were bug IMO; the third (copy_reg) is a work-around which recognizes that object.__init__() doesn't do anything.
-rw-r--r--Lib/copy_reg.py3
-rwxr-xr-xLib/test/test_array.py1
-rw-r--r--Lib/test/test_descr.py1
3 files changed, 2 insertions, 3 deletions
diff --git a/Lib/copy_reg.py b/Lib/copy_reg.py
index f87c50ffa4..0dd94cfc88 100644
--- a/Lib/copy_reg.py
+++ b/Lib/copy_reg.py
@@ -48,7 +48,8 @@ def _reconstructor(cls, base, state):
obj = object.__new__(cls)
else:
obj = base.__new__(cls, state)
- base.__init__(obj, state)
+ if base.__init__ != object.__init__:
+ base.__init__(obj, state)
return obj
_HEAPTYPE = 1<<9
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 597f3b2421..c10ad86eea 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -728,7 +728,6 @@ class CharacterTest(StringTest):
return array.array.__new__(cls, 'c', s)
def __init__(self, s, color='blue'):
- array.array.__init__(self, 'c', s)
self.color = color
def strip(self):
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 5abecf4b00..41c0bdf968 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -2305,7 +2305,6 @@ def inherits():
__slots__ = ['prec']
def __init__(self, value=0.0, prec=12):
self.prec = int(prec)
- float.__init__(self, value)
def __repr__(self):
return "%.*g" % (self.prec, self)
vereq(repr(precfloat(1.1)), "1.1")