From fb365e47dc3e74d1726c09c97f888b13d469eb15 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 29 Aug 2009 14:39:37 -0500 Subject: [PATCH] make print write each argument individually --HG-- branch : trunk --- py/builtin/builtin31.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/py/builtin/builtin31.py b/py/builtin/builtin31.py index 7ab6b8174..47283462e 100644 --- a/py/builtin/builtin31.py +++ b/py/builtin/builtin31.py @@ -28,8 +28,13 @@ else: if kwargs: args = ", ".join([str(x) for x in kwargs]) raise TypeError("invalid keyword arguments: %s" % args) - out = sep.join([str(x) for x in args]) + end - file.write(out) + at_start = True + for x in args: + if not at_start: + file.write(sep) + file.write(str(x)) + at_start = False + file.write(end) def exec_(obj, globals=None, locals=None): """ minimal backport of py3k exec statement. """