diff options
Diffstat (limited to 'Modules/posixmodule.c')
| -rw-r--r-- | Modules/posixmodule.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 0ea391e799..41fedb097e 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -2647,7 +2647,7 @@ os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd, #ifdef HAVE_TTYNAME /*[clinic input] -os.ttyname -> DecodeFSDefault +os.ttyname fd: int Integer file descriptor handle. @@ -2657,16 +2657,17 @@ os.ttyname -> DecodeFSDefault Return the name of the terminal device connected to 'fd'. [clinic start generated code]*/ -static char * +static PyObject * os_ttyname_impl(PyObject *module, int fd) -/*[clinic end generated code: output=ed16ad216d813591 input=5f72ca83e76b3b45]*/ +/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/ { char *ret; ret = ttyname(fd); - if (ret == NULL) - posix_error(); - return ret; + if (ret == NULL) { + return posix_error(); + } + return PyUnicode_DecodeFSDefault(ret); } #endif |
