diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-17 16:47:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-17 16:47:45 +0200 |
commit | 4db62e115891425db2a974142a72d8eaaf95eecb (patch) | |
tree | 76862de77aa5b95e61c1855d2832aca6d59873f2 /Modules/posixmodule.c | |
parent | e2af34fcf84b41189b54e1f2912faded5daabaca (diff) | |
download | cpython-git-4db62e115891425db2a974142a72d8eaaf95eecb.tar.gz |
bpo-35490: Remove the DecodeFSDefault return converter in AC. (#11152)
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 |