optimize set_release_vesion() to use strings format()
authorBrian Dolbec <dolsen@gentoo.org>
Thu, 6 Jun 2013 16:59:25 +0000 (09:59 -0700)
committerW. Trevor King <wking@tremily.us>
Tue, 11 Jun 2013 13:49:44 +0000 (09:49 -0400)
catalyst/version.py

index 6309a6c63d7f127bc46fcc72bc5ad939825bca4a..989945a4bc899216f3ce97328f52e172a496284a 100644 (file)
@@ -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))