File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,10 @@ test_k_code(PyObject *self, PyObject *Py_UNUSED(ignored))
345
345
}
346
346
347
347
unsigned long value = PyLong_AsUnsignedLongMask (num );
348
- if (value != ULONG_MAX ) {
348
+ if (value == (unsigned long )-1 && PyErr_Occurred ()) {
349
+ goto error ;
350
+ }
351
+ else if (value != ULONG_MAX ) {
349
352
Py_DECREF (num );
350
353
PyErr_SetString (PyExc_AssertionError ,
351
354
"test_k_code: "
@@ -376,7 +379,10 @@ test_k_code(PyObject *self, PyObject *Py_UNUSED(ignored))
376
379
}
377
380
378
381
value = PyLong_AsUnsignedLongMask (num );
379
- if (value != (unsigned long )-0x42 ) {
382
+ if (value == (unsigned long )-1 && PyErr_Occurred ()) {
383
+ goto error ;
384
+ }
385
+ else if (value != (unsigned long )-0x42 ) {
380
386
PyErr_SetString (PyExc_AssertionError ,
381
387
"test_k_code: "
382
388
"PyLong_AsUnsignedLongMask() returned wrong value for long -0xFFF..000042" );
You can’t perform that action at this time.
0 commit comments