diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-17 04:45:09 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-17 04:45:09 +0100 |
| commit | 1f33f2b0c381337d5991c227652d65eadd168209 (patch) | |
| tree | 4f2303936f90a15a9d7a132a3d5f57c238eba38d /Modules/socketmodule.c | |
| parent | f2ea71fcc8986101512265b685d8d3dfdf7b7bdb (diff) | |
| download | cpython-git-1f33f2b0c381337d5991c227652d65eadd168209.tar.gz | |
Issue #13560: os.strerror() now uses the current locale encoding instead of UTF-8
Diffstat (limited to 'Modules/socketmodule.c')
| -rw-r--r-- | Modules/socketmodule.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index c828d49e39..132d6c7780 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4032,9 +4032,8 @@ gethost_common(struct hostent *h, struct sockaddr *addr, int alen, int af) if (h->h_addrtype != af) { /* Let's get real error message to return */ - PyErr_SetString(PyExc_OSError, - (char *)strerror(EAFNOSUPPORT)); - + errno = EAFNOSUPPORT; + PyErr_SetFromErrno(PyExc_OSError); return NULL; } |
