File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
graalpython/com.oracle.graal.python.test/src/tests/cpyext Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,11 @@ def _reference_aslong(args):
56
56
def _reference_as_unsigned_long (args ):
57
57
# We cannot be sure if we are on 32-bit or 64-bit architecture. So, assume the smaller one.
58
58
n = args [0 ]
59
- if n > 0x7fffffff or n < 0 :
59
+ if n > 0xffffffff or n < 0 :
60
60
if sys .version_info .minor >= 6 :
61
- raise SystemError
61
+ exc = SystemError ()
62
+ exc .__cause__ = OverflowError ()
63
+ raise exc
62
64
else :
63
65
return - 1
64
66
return int (n )
@@ -171,11 +173,13 @@ def compile_module(self, name):
171
173
_reference_as_unsigned_long ,
172
174
lambda : (
173
175
(0 ,),
174
- # TODO disable because CPython 3.4.1 does not correctly catch exceptions from native
175
- # (-1 ,),
176
+ ( - 1 ,),
177
+ ( - 2 ,),
176
178
(0x7fffffff ,),
179
+ (0xffffffff ,),
180
+ # we could use larger values on 64-bit systems but how should we know?
177
181
),
178
- resultspec = "l " ,
182
+ resultspec = "k " ,
179
183
argspec = 'O' ,
180
184
arguments = ["PyObject* obj" ],
181
185
cmpfunc = unhandled_error_compare
You can’t perform that action at this time.
0 commit comments