Fix Python 2 builtin tp_hash hashfunc closure regression when using "python:slot"

Closes https://github.com/swig/swig/issues/843
This commit is contained in:
William S Fulton 2016-12-23 23:41:07 +00:00
commit 4963a7f88f
4 changed files with 35 additions and 3 deletions

View file

@ -12,10 +12,14 @@ if is_python_builtin():
if h != h2:
raise RuntimeError("default tp_hash not working")
# Test 1 for tp_hash
# Test 1a for tp_hash
if hash(SimpleValue(222)) != 222:
raise RuntimeError("tp_hash not working")
# Test 1b for tp_hash
if hash(SimpleValue2(333)) != 333:
raise RuntimeError("tp_hash not working")
# Test 2 for tp_hash
try:
# Was incorrectly raising: SystemError: error return without exception set