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
83ab9958
Commit
83ab9958
authored
Feb 01, 2018
by
Stéphane Wirtel
Committed by
Christian Heimes
Feb 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-32711: Fix warnings for Python/ast_unparse.c (#5426)
* bpo-32711: Fix warnings for Python/ast_unparse.c
parent
97f1ca16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
Misc/NEWS.d/next/Core and Builtins/2018-01-29-14-36-37.bpo-32711.8hQFJP.rst
...ore and Builtins/2018-01-29-14-36-37.bpo-32711.8hQFJP.rst
+1
-0
Python/ast_unparse.c
Python/ast_unparse.c
+7
-3
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-01-29-14-36-37.bpo-32711.8hQFJP.rst
0 → 100644
View file @
83ab9958
Fix the warning messages for Python/ast_unparse.c. Patch by Stéphane Wirtel
Python/ast_unparse.c
View file @
83ab9958
...
...
@@ -20,7 +20,7 @@ append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e, bool is_format_spec);
static
int
append_charp
(
_PyUnicodeWriter
*
writer
,
const
char
*
charp
)
{
return
_PyUnicodeWriter_WriteASCIIString
(
writer
,
charp
,
-
1
);
return
_PyUnicodeWriter_WriteASCIIString
(
writer
,
charp
,
-
1
);
}
static
int
...
...
@@ -100,6 +100,8 @@ append_ast_binop(_PyUnicodeWriter *writer, expr_ty e, bool omit_parens)
case
BitAnd
:
op
=
" & "
;
break
;
case
FloorDiv
:
op
=
" // "
;
break
;
case
Pow
:
op
=
" ** "
;
break
;
default:
Py_UNREACHABLE
();
}
if
(
-
1
==
append_charp
(
writer
,
op
))
{
...
...
@@ -127,6 +129,8 @@ append_ast_unaryop(_PyUnicodeWriter *writer, expr_ty e, bool omit_parens)
case
Not
:
op
=
"not "
;
break
;
case
UAdd
:
op
=
"+"
;
break
;
case
USub
:
op
=
"-"
;
break
;
default:
Py_UNREACHABLE
();
}
if
(
-
1
==
append_charp
(
writer
,
op
))
{
...
...
@@ -856,7 +860,7 @@ append_formattedvalue(_PyUnicodeWriter *writer, expr_ty e, bool is_format_spec)
return
-
1
;
}
}
if
(
e
->
v
.
FormattedValue
.
format_spec
>
0
)
{
if
(
e
->
v
.
FormattedValue
.
format_spec
)
{
if
(
-
1
==
_PyUnicodeWriter_WriteASCIIString
(
writer
,
":"
,
1
)
||
-
1
==
append_fstring_element
(
writer
,
e
->
v
.
FormattedValue
.
format_spec
,
...
...
@@ -1119,7 +1123,7 @@ append_ast_expr(_PyUnicodeWriter *writer, expr_ty e, bool omit_parens)
}
static
int
maybe_init_static_strings
()
maybe_init_static_strings
(
void
)
{
if
(
!
_str_open_br
&&
!
(
_str_open_br
=
PyUnicode_InternFromString
(
"{"
)))
{
...
...
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