Skip to content

Commit d187121

Browse files
committed
Fix merge conflicts.
1 parent 919300e commit d187121

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

Lib/test/test_capi/test_long.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,8 @@ def check_long_asintandoverflow(self, func, min_val, max_val):
208208

209209
self.assertEqual(func(min_val - 1), (-1, -1))
210210
self.assertEqual(func(max_val + 1), (-1, +1))
211-
212-
# CRASHES func(1.0)
213-
# CRASHES func(NULL)
211+
self.assertRaises(SystemError, func, None)
212+
self.assertRaises(TypeError, func, 1.0)
214213

215214
def test_long_aslong(self):
216215
# Test PyLong_AsLong() and PyLong_FromLong()

Modules/_testcapi/long.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ pylong_aslongandoverflow(PyObject *module, PyObject *arg)
629629
int overflow = UNINITIALIZED_INT;
630630
long value = PyLong_AsLongAndOverflow(arg, &overflow);
631631
if (value == -1 && PyErr_Occurred()) {
632-
assert(overflow == -1);
632+
assert(overflow == 0);
633633
return NULL;
634634
}
635635
return Py_BuildValue("li", value, overflow);

0 commit comments

Comments
 (0)