mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Change posix_error() to call err_errno().
This commit is contained in:
parent
2b654f74c2
commit
e8f305aec6
1 changed files with 2 additions and 10 deletions
|
@ -72,18 +72,10 @@ static object *PosixError; /* Exception posix.error */
|
||||||
|
|
||||||
/* Set a POSIX-specific error from errno, and return NULL */
|
/* Set a POSIX-specific error from errno, and return NULL */
|
||||||
|
|
||||||
static object *
|
extern object *
|
||||||
posix_error()
|
posix_error()
|
||||||
{
|
{
|
||||||
object *v = newtupleobject(2);
|
return err_errno(PosixError);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue