[pypy-commit] pypy py3.6: hg merge default
rlamy
pypy.commits at gmail.com
Mon Jan 20 23:19:36 EST 2020
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.6
Changeset: r98566:3811ac3540f6
Date: 2020-01-21 04:18 +0000
http://bitbucket.org/pypy/pypy/changeset/3811ac3540f6/
Log: hg merge default
diff --git a/pypy/module/__builtin__/test/test_abstractinst.py b/pypy/module/__builtin__/test/test_abstractinst.py
--- a/pypy/module/__builtin__/test/test_abstractinst.py
+++ b/pypy/module/__builtin__/test/test_abstractinst.py
@@ -215,7 +215,7 @@
def test_dont_call_instancecheck_fast_path(self):
called = []
-
+
class M(type):
def __instancecheck__(self, obj):
called.append("called")
@@ -271,3 +271,25 @@
skip("non-normalized exception") #raise Special, ValueError()
except Special:
pass
+
+ def test_exception_bad_subclasscheck(self):
+ """
+ import sys
+ class Meta(type):
+ def __subclasscheck__(cls, subclass):
+ raise ValueError()
+
+ class MyException(Exception, metaclass=Meta):
+ pass
+
+ try:
+ raise KeyError()
+ except MyException as e:
+ assert False, "exception should not be a MyException"
+ except KeyError:
+ pass
+ except:
+ assert False, "Should have raised KeyError"
+ else:
+ assert False, "Should have raised KeyError"
+ """
More information about the pypy-commit
mailing list