summaryrefslogtreecommitdiff
path: root/gbp/scripts/rpm_ch.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/scripts/rpm_ch.py')
-rwxr-xr-xgbp/scripts/rpm_ch.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gbp/scripts/rpm_ch.py b/gbp/scripts/rpm_ch.py
index 33058372..e5fddb4e 100755
--- a/gbp/scripts/rpm_ch.py
+++ b/gbp/scripts/rpm_ch.py
@@ -18,7 +18,7 @@
#
"""Generate RPM changelog entries from git commit messages"""
-import ConfigParser
+import configparser
from datetime import datetime
import os.path
import pwd
@@ -92,7 +92,7 @@ def load_customizations(customization_file):
return
customizations = {}
try:
- execfile(customization_file, customizations, customizations)
+ exec(compile(open(customization_file, "rb").read(), customization_file, 'exec'), customizations, customizations)
except Exception as err:
raise GbpError("Failed to load customization file: %s" % err)
@@ -134,7 +134,7 @@ def check_repo_state(repo, options):
if options.commit:
unstaged = []
status = repo.status()
- for group, files in status.iteritems():
+ for group, files in status.items():
if group != '??' and group[1] != ' ':
unstaged.extend(files)
if unstaged:
@@ -340,7 +340,7 @@ def update_changelog(changelog, entries, repo, spec, options):
revision = options.changelog_revision % rev_str_fields
except KeyError as err:
raise GbpError("Unable to construct revision field: unknown key "
- "%s, only %s are accepted" % (err, rev_str_fields.keys()))
+ "%s, only %s are accepted" % (err, list(rev_str_fields.keys())))
# Add a new changelog section if new release or an empty changelog
if options.release or not changelog.sections:
@@ -366,7 +366,7 @@ def create_commit_message(spec, options):
return options.commit_msg % fields
except KeyError as err:
raise GbpError("Unknown key %s in commit-msg string, "
- "only %s are accepted" % (err, fields.keys()))
+ "only %s are accepted" % (err, list(fields.keys())))
def commit_changelog(repo, changelog, message, author, committer, edit):
"""Commit changelog and create a packaging/release tag"""
@@ -380,7 +380,7 @@ def parse_args(argv):
try:
parser = GbpOptionParserRpm(command=os.path.basename(argv[0]),
prefix='', usage='%prog [options] paths')
- except ConfigParser.ParsingError as err:
+ except configparser.ParsingError as err:
gbp.log.error('invalid config file: %s' % err)
return None, None