summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToilal <toilal.dev@gmail.com>2014-02-17 07:50:27 +0100
committerToilal <toilal.dev@gmail.com>2014-02-17 07:50:27 +0100
commitb1f29780de7bc8bb0c37f0c786691a44ca394efc (patch)
tree44ea8ba70d332d6e5244c8fa34898d3883987e38
parent8039dbd39e71f1a0b525381965a849535ef32e5c (diff)
downloadpbr-b1f29780de7bc8bb0c37f0c786691a44ca394efc.tar.gz
Add support for python 3-<3.3
Use unicode_literals import instead of u'unicode' notation. Change-Id: I6e6aba938ae43399d5aa398344c219fe43649034 Closes-Bug: #1276139
-rw-r--r--pbr/packaging.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index 414313c..8fe934a 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -20,6 +20,8 @@
Utilities with minimum-depends for use in setup.py
"""
+from __future__ import unicode_literals
+
import email
import io
import os
@@ -269,7 +271,7 @@ def write_git_changelog(git_dir=None, dest_dir=os.path.curdir,
first_line = True
with io.open(new_changelog, "w",
encoding="utf-8") as changelog_file:
- changelog_file.write(u"CHANGES\n=======\n\n")
+ changelog_file.write("CHANGES\n=======\n\n")
for line in changelog.split('\n'):
line_parts = line.split()
if len(line_parts) < 2:
@@ -292,7 +294,7 @@ def write_git_changelog(git_dir=None, dest_dir=os.path.curdir,
if not first_line:
changelog_file.write(u'\n')
changelog_file.write(
- (u"%(tag)s\n%(underline)s\n\n" %
+ ("%(tag)s\n%(underline)s\n\n" %
dict(tag=tag,
underline=underline)))
@@ -300,7 +302,7 @@ def write_git_changelog(git_dir=None, dest_dir=os.path.curdir,
if msg.endswith("."):
msg = msg[:-1]
changelog_file.write(
- (u"* %(msg)s\n" % dict(msg=msg)))
+ ("* %(msg)s\n" % dict(msg=msg)))
first_line = False