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
891bc654
Commit
891bc654
authored
Jul 03, 2000
by
Marc-André Lemburg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If auto-conversion fails, the Unicode codecs will return NULL.
This is now checked and the error passed on to the caller.
parent
52dc76c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
Objects/object.c
Objects/object.c
+13
-11
No files found.
Objects/object.c
View file @
891bc654
...
...
@@ -268,10 +268,11 @@ PyObject_Repr(v)
if
(
PyUnicode_Check
(
res
))
{
PyObject
*
str
;
str
=
PyUnicode_AsEncodedString
(
res
,
NULL
,
NULL
);
if
(
str
)
{
Py_DECREF
(
res
);
Py_DECREF
(
res
);
if
(
str
)
res
=
str
;
}
else
return
NULL
;
}
if
(
!
PyString_Check
(
res
))
{
PyErr_Format
(
PyExc_TypeError
,
...
...
@@ -310,14 +311,15 @@ PyObject_Str(v)
}
if
(
res
==
NULL
)
return
NULL
;
if
(
PyUnicode_Check
(
res
))
{
PyObject
*
str
;
str
=
PyUnicode_AsEncodedString
(
res
,
NULL
,
NULL
);
if
(
str
)
{
Py_DECREF
(
res
);
res
=
str
;
}
}
if
(
PyUnicode_Check
(
res
))
{
PyObject
*
str
;
str
=
PyUnicode_AsEncodedString
(
res
,
NULL
,
NULL
);
Py_DECREF
(
res
);
if
(
str
)
res
=
str
;
else
return
NULL
;
}
if
(
!
PyString_Check
(
res
))
{
PyErr_Format
(
PyExc_TypeError
,
"__str__ returned non-string (type %.200s)"
,
...
...
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