summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-12-14 04:19:56 (GMT)
committerGuido van Rossum <guido@python.org>2001-12-14 04:19:56 (GMT)
commite54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8 (patch)
treec8bab15509c8f6436c7fb03af0d9cbfd88902bef /Lib
parent7ec1c85d7a87e1aff699421d741be8dfca2adee9 (diff)
downloadcpython-e54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8.zip
cpython-e54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8.tar.gz
cpython-e54616cb6fdd9f9fb0d86ddd2cd5c4ffb51771b8.tar.bz2
(Merge into trunk.)
Fix for SF bug #492345. (I could've sworn I checked this in, but apparently I didn't!) This code: class Classic: pass class New(Classic): __metaclass__ = type attempts to create a new-style class with only classic bases -- but it doesn't work right. Attempts to fix it so it works caused problems elsewhere, so I'm now raising a TypeError in this case.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_descr.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py
index 1ec7c19..ea987f2 100644
--- a/Lib/test/test_descr.py
+++ b/Lib/test/test_descr.py
@@ -922,6 +922,16 @@ def multi():
vereq(m.m3method(), "M3 a")
vereq(m.all_method(), "M3 b")
+ class Classic:
+ pass
+ try:
+ class New(Classic):
+ __metaclass__ = type
+ except TypeError:
+ pass
+ else:
+ raise TestFailed, "new class with only classic bases - shouldn't be"
+
def diamond():
if verbose: print "Testing multiple inheritance special cases..."
class A(object):