From: Brian Dolbec Date: Thu, 6 Jun 2013 16:59:25 +0000 (-0700) Subject: optimize set_release_vesion() to use strings format() X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=12b84c621a013025336835f8f0f6bb848b016978;p=catalyst.git optimize set_release_vesion() to use strings format() --- 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))