git-changelog: Fix running on Python 3

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-07-02 10:26:37 +02:00
parent 46333b01ad
commit fc362c5347

View File

@ -33,10 +33,12 @@ class ChangeLog:
self.version = version self.version = version
def _getCommitDetail(self, commit, field): def _getCommitDetail(self, commit, field):
proc = subprocess.Popen(['git', 'log', '-1', proc = subprocess.Popen(
"--pretty=format:%s" % field, commit], ["git", "log", "-1", "--pretty=format:%s" % field, commit],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate() stderr=subprocess.PIPE,
universal_newlines=True,
).communicate()
ret = proc[0].strip('\n').split('\n') ret = proc[0].strip('\n').split('\n')
@ -54,10 +56,12 @@ class ChangeLog:
range = "%s.." % (self.version) range = "%s.." % (self.version)
else: else:
range = "%s-%s.." % (self.name, self.version) range = "%s-%s.." % (self.name, self.version)
proc = subprocess.Popen(['git', 'log', '--pretty=oneline', proc = subprocess.Popen(
'--no-merges', range], ["git", "log", "--pretty=oneline", "--no-merges", range],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE).communicate() stderr=subprocess.PIPE,
universal_newlines=True,
).communicate()
lines = filter(lambda x: x.find('l10n: ') != 41, lines = filter(lambda x: x.find('l10n: ') != 41,
proc[0].strip('\n').split('\n')) proc[0].strip('\n').split('\n'))