Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4db62e11
Commit
4db62e11
authored
Dec 17, 2018
by
Serhiy Storchaka
Committed by
GitHub
Dec 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35490: Remove the DecodeFSDefault return converter in AC. (#11152)
parent
e2af34fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
24 deletions
+10
-24
Modules/clinic/posixmodule.c.h
Modules/clinic/posixmodule.c.h
+3
-8
Modules/posixmodule.c
Modules/posixmodule.c
+7
-6
Tools/clinic/clinic.py
Tools/clinic/clinic.py
+0
-10
No files found.
Modules/clinic/posixmodule.c.h
View file @
4db62e11
...
...
@@ -176,7 +176,7 @@ PyDoc_STRVAR(os_ttyname__doc__,
#define OS_TTYNAME_METHODDEF \
{"ttyname", (PyCFunction)os_ttyname, METH_O, os_ttyname__doc__},
static
char
*
static
PyObject
*
os_ttyname_impl
(
PyObject
*
module
,
int
fd
);
static
PyObject
*
...
...
@@ -184,16 +184,11 @@ os_ttyname(PyObject *module, PyObject *arg)
{
PyObject
*
return_value
=
NULL
;
int
fd
;
char
*
_return_value
;
if
(
!
PyArg_Parse
(
arg
,
"i:ttyname"
,
&
fd
))
{
goto
exit
;
}
_return_value
=
os_ttyname_impl
(
module
,
fd
);
if
(
_return_value
==
NULL
)
{
goto
exit
;
}
return_value
=
PyUnicode_DecodeFSDefault
(
_return_value
);
return_value
=
os_ttyname_impl
(
module
,
fd
);
exit:
return
return_value
;
...
...
@@ -6758,4 +6753,4 @@ exit:
#ifndef OS_GETRANDOM_METHODDEF
#define OS_GETRANDOM_METHODDEF
#endif
/* !defined(OS_GETRANDOM_METHODDEF) */
/*[clinic end generated code: output=
7ebb53d872bab149
input=a9049054013a1b77]*/
/*[clinic end generated code: output=
87a3ebadb91bc46b
input=a9049054013a1b77]*/
Modules/posixmodule.c
View file @
4db62e11
...
...
@@ -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=5f72ca83e76b3b4
5]*/
/*[clinic end generated code: output=
c424d2e9d1cd636a input=9ff5a58b08115c5
5]*/
{
char
*
ret
;
ret
=
ttyname
(
fd
);
if
(
ret
==
NULL
)
posix_error
();
return
ret
;
if
(
ret
==
NULL
)
{
return
posix_error
();
}
return
PyUnicode_DecodeFSDefault
(
ret
);
}
#endif
...
...
Tools/clinic/clinic.py
View file @
4db62e11
...
...
@@ -3166,16 +3166,6 @@ class float_return_converter(double_return_converter):
cast
=
'(double)'
class
DecodeFSDefault_return_converter
(
CReturnConverter
):
type
=
'char *'
def
render
(
self
,
function
,
data
):
self
.
declare
(
data
)
self
.
err_occurred_if_null_pointer
(
"_return_value"
,
data
)
data
.
return_conversion
.
append
(
'return_value = PyUnicode_DecodeFSDefault(_return_value);
\
n
'
)
def
eval_ast_expr
(
node
,
globals
,
*
,
filename
=
'-'
):
"""
Takes an ast.Expr node. Compiles and evaluates it.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment