Change error return value to be more consistent with the rest of Python
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index c8abda2..5da2e93 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -780,7 +780,7 @@
if (!PyCode_Check(code)) {
PyErr_BadInternalCall();
- return 1;
+ return -1;
}
o = (PyCodeObject*) code;
@@ -803,7 +803,7 @@
if (!PyCode_Check(code) || index < 0 ||
index >= tstate->co_extra_user_count) {
PyErr_BadInternalCall();
- return 1;
+ return -1;
}
o = (PyCodeObject*) code;
@@ -812,13 +812,13 @@
o->co_extra = (_PyCodeObjectExtra*) PyMem_Malloc(
sizeof(_PyCodeObjectExtra));
if (o->co_extra == NULL) {
- return 1;
+ return -1;
}
o->co_extra->ce_extras = PyMem_Malloc(
tstate->co_extra_user_count * sizeof(void*));
if (o->co_extra->ce_extras == NULL) {
- return 1;
+ return -1;
}
o->co_extra->ce_size = tstate->co_extra_user_count;
@@ -832,7 +832,7 @@
o->co_extra->ce_extras, tstate->co_extra_user_count * sizeof(void*));
if (o->co_extra->ce_extras == NULL) {
- return 1;
+ return -1;
}
o->co_extra->ce_size = tstate->co_extra_user_count;