Author: Ronan Lamy <ronan.l...@gmail.com>
Branch: py3.5
Changeset: r92275:f3328bccb6b2
Date: 2017-08-28 18:28 +0100
http://bitbucket.org/pypy/pypy/changeset/f3328bccb6b2/

Log:    fix merge

diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -1660,7 +1660,6 @@
             # overwritten with a new error of the same type
             error = PyErr_Occurred(space)
             has_new_error = (error is not None) and (error is not 
preexist_error)
-            has_result = ret is not None
             if not expect_null and has_new_error and has_result:
                 raise oefmt(space.w_SystemError,
                             "An exception was set, but function returned a "
diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -739,10 +739,10 @@
         # uncaught interplevel exceptions are turned into SystemError
         expected = "ZeroDivisionError('integer division or modulo by zero',)"
         exc = raises(SystemError, module.crash1)
-        assert exc.value[0] == expected
+        assert exc.value.args[0] == expected
 
         exc = raises(SystemError, module.crash2)
-        assert exc.value[0] == expected
+        assert exc.value.args[0] == expected
 
         # caught exception, api.cpython_api return value works
         assert module.crash3() == -1
@@ -750,7 +750,7 @@
         expected = 'An exception was set, but function returned a value'
         # PyPy only incompatibility/extension
         exc = raises(SystemError, module.crash4)
-        assert exc.value[0] == expected
+        assert exc.value.args[0] == expected
 
         # An exception was set by the previous call, it can pass
         # cleanly through a call that doesn't check error state
@@ -759,7 +759,7 @@
         # clear the exception but return NULL, signalling an error
         expected = 'Function returned a NULL result without setting an 
exception'
         exc = raises(SystemError, module.clear, None)
-        assert exc.value[0] == expected
+        assert exc.value.args[0] == expected
 
         # Set an exception and return NULL
         raises(TypeError, module.set, None)
@@ -770,7 +770,7 @@
         # Set an exception, but return non-NULL
         expected = 'An exception was set, but function returned a value'
         exc = raises(SystemError, module.set, 1)
-        assert exc.value[0] == expected
+        assert exc.value.args[0] == expected
 
 
         # Clear the exception and return a value, all is OK
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to