diff options
author | Guido van Rossum <guido@python.org> | 2002-12-13 17:49:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-12-13 17:49:38 (GMT) |
commit | 3bbc0eea1045657a054cf302ca98d1236eab058b (patch) | |
tree | 00165bca78382de52ac711fe3f463381aff8f1e4 /Lib/test/test_descr.py | |
parent | 3d87e3cdf7420849e98f153c806fe50fe5131961 (diff) | |
download | cpython-3bbc0eea1045657a054cf302ca98d1236eab058b.zip cpython-3bbc0eea1045657a054cf302ca98d1236eab058b.tar.gz cpython-3bbc0eea1045657a054cf302ca98d1236eab058b.tar.bz2 |
Tighten the tests for assignment to __bases__: disallow empty tuple.
Diffstat (limited to 'Lib/test/test_descr.py')
-rw-r--r-- | Lib/test/test_descr.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index ed4593e..5a1fcec 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3486,6 +3486,14 @@ def test_mutable_bases(): raise TestFailed, "shouldn't be able to delete .__bases__" try: + D.__bases__ = () + except TypeError, msg: + if str(msg) == "a new-style class can't have only classic bases": + raise TestFailed, "wrong error message for .__bases__ = ()" + else: + raise TestFailed, "shouldn't be able to set .__bases__ to ()" + + try: D.__bases__ = (D,) except TypeError: pass |