From: Guido van Rossum Date: Sun, 14 Oct 1990 20:04:28 +0000 (+0000) Subject: Change posix_error() to call err_errno(). X-Git-Tag: v0.9.8~1168 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e8f305aec6f2f2ee6b43e4efb9ae9d9bb306312a;p=thirdparty%2FPython%2Fcpython.git Change posix_error() to call err_errno(). --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0c1a487dba1b..b7b2346e18fb 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -72,18 +72,10 @@ static object *PosixError; /* Exception posix.error */ /* Set a POSIX-specific error from errno, and return NULL */ -static object * +extern object * posix_error() { - object *v = newtupleobject(2); - if (v != NULL) { - settupleitem(v, 0, newintobject((long)errno)); - settupleitem(v, 1, newstringobject(strerror(errno))); - } - err_setval(PosixError, v); - if (v != NULL) - DECREF(v); - return NULL; + return err_errno(PosixError); }