mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
Correctly forward exception in instance_contains().
Fixes #1591996. Patch contributed by Neal Norwitz. Will backport.
This commit is contained in:
parent
e452f51bc4
commit
3a62404264
2 changed files with 14 additions and 4 deletions
|
@ -172,6 +172,14 @@ testme ^ 1
|
|||
|
||||
# List/dict operations
|
||||
|
||||
class Empty: pass
|
||||
|
||||
try:
|
||||
1 in Empty()
|
||||
print 'failed, should have raised TypeError'
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
1 in testme
|
||||
|
||||
testme[1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue