aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYves Chevallier <nowox@x0x.ch>2017-06-15 10:06:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-07-05 15:16:24 -0400
commit037a95e7302d4a8d3dae1d4ad64a879ecd64791b (patch)
treefa12cbaa76f35ef4b0367d52b8d5f6095672c1df
parentc7b3792b6e215fe7a5e79c9170b5db858c5738be (diff)
downloadexternal_python_mako-037a95e7302d4a8d3dae1d4ad64a879ecd64791b.tar.gz
external_python_mako-037a95e7302d4a8d3dae1d4ad64a879ecd64791b.tar.bz2
external_python_mako-037a95e7302d4a8d3dae1d4ad64a879ecd64791b.zip
Use sys.stdout.write instead of print in cmdline
The `print` function adds an unwanted `\n` char. Change-Id: I4e345214352f0925c374145f41be45550da27393 Pull-request: https://github.com/zzzeek/mako/pull/23
-rw-r--r--doc/build/changelog.rst8
-rwxr-xr-xmako/cmd.py2
2 files changed, 9 insertions, 1 deletions
diff --git a/doc/build/changelog.rst b/doc/build/changelog.rst
index 4df879f..38bef1c 100644
--- a/doc/build/changelog.rst
+++ b/doc/build/changelog.rst
@@ -8,6 +8,14 @@ Changelog
.. changelog::
:version: 1.0.7
+ .. change::
+ :tags: bug
+
+ Changed the "print" in the mako-render command to
+ sys.stdout.write(), avoiding the extra newline at the end
+ of the template output. Pull request courtesy
+ Yves Chevallier.
+
.. changelog::
:version: 1.0.6
:released: Wed Nov 9 2016
diff --git a/mako/cmd.py b/mako/cmd.py
index dd1f833..8db1346 100755
--- a/mako/cmd.py
+++ b/mako/cmd.py
@@ -58,7 +58,7 @@ def cmdline(argv=None):
kw = dict([varsplit(var) for var in options.var])
try:
- print(template.render(**kw))
+ sys.stdout.write(template.render(**kw))
except:
_exit()