mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Use unicode and remove support for some uses of str8.
This commit is contained in:
parent
6ea45d3341
commit
ed2b7397a0
5 changed files with 15 additions and 31 deletions
|
@ -833,10 +833,7 @@ SyntaxError_str(PySyntaxErrorObject *self)
|
|||
/* XXX -- do all the additional formatting with filename and
|
||||
lineno here */
|
||||
|
||||
if (self->filename) {
|
||||
if (PyString_Check(self->filename))
|
||||
filename = PyString_AsString(self->filename);
|
||||
else if (PyUnicode_Check(self->filename))
|
||||
if (self->filename && PyUnicode_Check(self->filename)) {
|
||||
filename = PyUnicode_AsString(self->filename);
|
||||
}
|
||||
have_lineno = (self->lineno != NULL) && PyInt_CheckExact(self->lineno);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue