summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index bd16fa8..fa2cd37 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1000,9 +1000,10 @@ bp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
(unsigned char *)p,
8,
0, /* little_endian */
- 1 /* signed */);
+ 1, /* signed */
+ 0 /* !with_exceptions */);
Py_DECREF(v);
- if (res == -1 && PyErr_Occurred()) {
+ if (res < 0) {
PyErr_Format(state->StructError,
"'%c' format requires %lld <= number <= %lld",
f->format,
@@ -1024,9 +1025,10 @@ bp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f
(unsigned char *)p,
8,
0, /* little_endian */
- 0 /* signed */);
+ 0, /* signed */
+ 0 /* !with_exceptions */);
Py_DECREF(v);
- if (res == -1 && PyErr_Occurred()) {
+ if (res < 0) {
PyErr_Format(state->StructError,
"'%c' format requires 0 <= number <= %llu",
f->format,
@@ -1260,9 +1262,10 @@ lp_longlong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f)
(unsigned char *)p,
8,
1, /* little_endian */
- 1 /* signed */);
+ 1, /* signed */
+ 0 /* !with_exceptions */);
Py_DECREF(v);
- if (res == -1 && PyErr_Occurred()) {
+ if (res < 0) {
PyErr_Format(state->StructError,
"'%c' format requires %lld <= number <= %lld",
f->format,
@@ -1284,9 +1287,10 @@ lp_ulonglong(_structmodulestate *state, char *p, PyObject *v, const formatdef *f
(unsigned char *)p,
8,
1, /* little_endian */
- 0 /* signed */);
+ 0, /* signed */
+ 0 /* !with_exceptions */);
Py_DECREF(v);
- if (res == -1 && PyErr_Occurred()) {
+ if (res < 0) {
PyErr_Format(state->StructError,
"'%c' format requires 0 <= number <= %llu",
f->format,