summaryrefslogtreecommitdiff
path: root/gbp/scripts/common/pq.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/common/pq.py')
-rw-r--r--gbp/scripts/common/pq.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/gbp/scripts/common/pq.py b/gbp/scripts/common/pq.py
index a91ec8e9..60157b2f 100644
--- a/gbp/scripts/common/pq.py
+++ b/gbp/scripts/common/pq.py
@@ -180,7 +180,7 @@ def patch_path_filter(file_status, exclude_regex=None):
"""
if exclude_regex:
include_paths = []
- for file_list in file_status.values():
+ for file_list in list(file_status.values()):
for fname in file_list:
if not re.match(exclude_regex, fname):
include_paths.append(fname)
@@ -208,13 +208,13 @@ def write_patch_file(filename, commit_info, diff):
# Git compat: put name in quotes if special characters found
if re.search("[,.@()\[\]\\\:;]", name):
name = '"%s"' % name
- from_header = Header(unicode(name, 'utf-8'), charset, 77, 'from')
- from_header.append(unicode('<%s>' % email))
+ from_header = Header(str(name, 'utf-8'), charset, 77, 'from')
+ from_header.append(str('<%s>' % email))
msg['From'] = from_header
date = commit_info['author'].datetime
datestr = date.strftime('%a, %-d %b %Y %H:%M:%S %z')
- msg['Date'] = Header(unicode(datestr, 'utf-8'), charset, 77, 'date')
- msg['Subject'] = Header(unicode(commit_info['subject'], 'utf-8'),
+ msg['Date'] = Header(str(datestr, 'utf-8'), charset, 77, 'date')
+ msg['Subject'] = Header(str(commit_info['subject'], 'utf-8'),
charset, 77, 'subject')
# Write message body
if commit_info['body']: