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
06610090
Commit
06610090
authored
Aug 16, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of some dead code and unneeded XXX comments by Neal.
parent
5f22af16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
17 deletions
+4
-17
Modules/datetimemodule.c
Modules/datetimemodule.c
+1
-6
Objects/unicodeobject.c
Objects/unicodeobject.c
+3
-11
No files found.
Modules/datetimemodule.c
View file @
06610090
...
...
@@ -1159,17 +1159,12 @@ make_Zreplacement(PyObject *object, PyObject *tzinfoarg)
if
(
Zreplacement
==
NULL
)
return
NULL
;
if
(
PyUnicode_Check
(
Zreplacement
))
{
/* XXX(nnorwitz): this is really convoluted, is it correct? */
PyObject
*
Zreplacement2
=
_PyUnicode_AsDefaultEncodedString
(
Zreplacement
,
NULL
);
if
(
Zreplacement2
==
NULL
)
return
NULL
;
Py_INCREF
(
Zreplacement2
);
/* Zreplacement is owned, but Zreplacement2 is borrowed.
If they are different, we have to release Zreplacement. */
if
(
Zreplacement
!=
Zreplacement2
)
{
Py_DECREF
(
Zreplacement
);
}
Py_DECREF
(
Zreplacement
);
Zreplacement
=
Zreplacement2
;
}
if
(
!
PyString_Check
(
Zreplacement
))
{
...
...
Objects/unicodeobject.c
View file @
06610090
...
...
@@ -1189,17 +1189,9 @@ PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode,
return
v
;
if
(
errors
!=
NULL
)
Py_FatalError
(
"non-NULL encoding in _PyUnicode_AsDefaultEncodedString"
);
/* XXX(nnorwitz): errors will always be NULL due to the check above.
Should this check and the else be removed since it's dead code?
*/
if
(
errors
==
NULL
)
{
b
=
PyUnicode_EncodeUTF8
(
PyUnicode_AS_UNICODE
(
unicode
),
PyUnicode_GET_SIZE
(
unicode
),
NULL
);
}
else
{
b
=
PyUnicode_AsEncodedString
(
unicode
,
NULL
,
errors
);
}
b
=
PyUnicode_EncodeUTF8
(
PyUnicode_AS_UNICODE
(
unicode
),
PyUnicode_GET_SIZE
(
unicode
),
NULL
);
if
(
!
b
)
return
NULL
;
v
=
PyString_FromStringAndSize
(
PyBytes_AsString
(
b
),
...
...
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