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
c963731b
Commit
c963731b
authored
Jul 02, 2009
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor logic a little when no sep or end is passed
parent
b18d26d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Python/bltinmodule.c
Python/bltinmodule.c
+10
-4
No files found.
Python/bltinmodule.c
View file @
c963731b
...
...
@@ -1459,13 +1459,19 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
Py_RETURN_NONE
;
}
if
(
sep
&&
sep
!=
Py_None
&&
!
PyUnicode_Check
(
sep
))
{
if
(
sep
==
Py_None
)
{
sep
=
NULL
;
}
else
if
(
sep
&&
!
PyUnicode_Check
(
sep
))
{
PyErr_Format
(
PyExc_TypeError
,
"sep must be None or a string, not %.200s"
,
sep
->
ob_type
->
tp_name
);
return
NULL
;
}
if
(
end
&&
end
!=
Py_None
&&
!
PyUnicode_Check
(
end
))
{
if
(
end
==
Py_None
)
{
end
=
NULL
;
}
else
if
(
end
&&
!
PyUnicode_Check
(
end
))
{
PyErr_Format
(
PyExc_TypeError
,
"end must be None or a string, not %.200s"
,
end
->
ob_type
->
tp_name
);
...
...
@@ -1474,7 +1480,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
for
(
i
=
0
;
i
<
PyTuple_Size
(
args
);
i
++
)
{
if
(
i
>
0
)
{
if
(
sep
==
NULL
||
sep
==
Py_None
)
if
(
sep
==
NULL
)
err
=
PyFile_WriteString
(
" "
,
file
);
else
err
=
PyFile_WriteObject
(
sep
,
file
,
...
...
@@ -1488,7 +1494,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds)
return
NULL
;
}
if
(
end
==
NULL
||
end
==
Py_None
)
if
(
end
==
NULL
)
err
=
PyFile_WriteString
(
"
\n
"
,
file
);
else
err
=
PyFile_WriteObject
(
end
,
file
,
Py_PRINT_RAW
);
...
...
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