From b30a5fc117ec3797b7c9f8f66df94b899715eb27 Mon Sep 17 00:00:00 2001 From: Brian Dolbec Date: Thu, 6 Jun 2013 09:59:25 -0700 Subject: [PATCH] optimize set_release_vesion() to use strings format() --- catalyst/version.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/catalyst/version.py b/catalyst/version.py index 6309a6c6..989945a4 100644 --- a/catalyst/version.py +++ b/catalyst/version.py @@ -56,9 +56,8 @@ def set_release_version(version, root=None): path = pjoin(os.path.dirname(__file__), filename) else: path = pjoin(root, filename) - #__version__ = version + __version__ = version ver = get_git_version(version) - ver = ver.replace('\n', '\\n') with open(path, 'w') as f: - f.write("version = '%s'" % ver) + f.write("version = {0!r}".format(ver)) -- 2.26.2