Kaydet (Commit) 6d946f98 authored tarafından Guido van Rossum's avatar Guido van Rossum

* macmodule.c: include allobjects.h, not .c

* timemodule.c: the mac has no unistd.h
* classobject.c: fixed several cases of return NULL that should be
  return -1 !!!
üst e6eefc22
...@@ -33,6 +33,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ...@@ -33,6 +33,10 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
#ifdef macintosh
#define NO_UNISTD
#endif
#ifndef NO_UNISTD #ifndef NO_UNISTD
#include <unistd.h> #include <unistd.h>
#endif #endif
......
...@@ -396,7 +396,7 @@ instance_ass_subscript(inst, key, value) ...@@ -396,7 +396,7 @@ instance_ass_subscript(inst, key, value)
arg = mkvalue("(OO)", key, value); arg = mkvalue("(OO)", key, value);
if (arg == NULL) { if (arg == NULL) {
DECREF(func); DECREF(func);
return NULL; return -1;
} }
res = call_object(func, arg); res = call_object(func, arg);
DECREF(func); DECREF(func);
...@@ -509,14 +509,14 @@ instance_ass_item(inst, i, item) ...@@ -509,14 +509,14 @@ instance_ass_item(inst, i, item)
else else
func = instance_getattr(inst, "__setitem__"); func = instance_getattr(inst, "__setitem__");
if (func == NULL) if (func == NULL)
return NULL; return -1;
if (item == NULL) if (item == NULL)
arg = mkvalue("i", i); arg = mkvalue("i", i);
else else
arg = mkvalue("(iO)", i, item); arg = mkvalue("(iO)", i, item);
if (arg == NULL) { if (arg == NULL) {
DECREF(func); DECREF(func);
return NULL; return -1;
} }
res = call_object(func, arg); res = call_object(func, arg);
DECREF(func); DECREF(func);
...@@ -540,14 +540,14 @@ instance_ass_slice(inst, i, j, value) ...@@ -540,14 +540,14 @@ instance_ass_slice(inst, i, j, value)
else else
func = instance_getattr(inst, "__setslice__"); func = instance_getattr(inst, "__setslice__");
if (func == NULL) if (func == NULL)
return NULL; return -1;
if (value == NULL) if (value == NULL)
arg = mkvalue("(ii)", i, j); arg = mkvalue("(ii)", i, j);
else else
arg = mkvalue("(iiO)", i, j, value); arg = mkvalue("(iiO)", i, j, value);
if (arg == NULL) { if (arg == NULL) {
DECREF(func); DECREF(func);
return NULL; return -1;
} }
res = call_object(func, arg); res = call_object(func, arg);
DECREF(func); DECREF(func);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment