libreport/0038-report-client-fix-minor-python3-incompatibilities.patch
2014-12-08 12:00:30 +01:00

79 lines
2.9 KiB
Diff

From aa02f3ca6d20a2ca1cf1ffd2dffbf231312a0d5e Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Mon, 8 Dec 2014 11:00:17 +0100
Subject: [PATCH] report, client: fix minor python3 incompatibilities
Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
src/client-python/__init__.py | 1 +
src/client-python/debuginfo.py | 4 ++--
src/report-python/__init__.py | 2 +-
src/report-python/libreport-meh-test.py | 6 +++---
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/client-python/__init__.py b/src/client-python/__init__.py
index 8966f22..129149a 100644
--- a/src/client-python/__init__.py
+++ b/src/client-python/__init__.py
@@ -76,3 +76,4 @@ def error_msg(fmt, *args):
def error_msg_and_die(fmt, *args):
sys.stderr.write("%s\n" % (fmt % args))
sys.exit(1)
+
diff --git a/src/client-python/debuginfo.py b/src/client-python/debuginfo.py
index 67faa45..421a0aa 100644
--- a/src/client-python/debuginfo.py
+++ b/src/client-python/debuginfo.py
@@ -84,7 +84,7 @@ def unpack_rpm(package_file_name, files, tmp_dir, destdir, keeprpm, exact_files=
package_full_path = tmp_dir + "/" + package_file_name
log1("Extracting %s to %s", package_full_path, destdir)
log2("%s", files)
- print _("Extracting cpio from {0}").format(package_full_path)
+ print(_("Extracting cpio from {0}").format(package_full_path))
unpacked_cpio_path = tmp_dir + "/unpacked.cpio"
try:
unpacked_cpio = open(unpacked_cpio_path, 'wb')
@@ -447,7 +447,7 @@ class DebugInfoDownload(YumBase):
print _("Download cancelled by user")
return RETURN_CANCEL_BY_USER
- for pkg, files in package_files_dict.iteritems():
+ for pkg, files in package_files_dict.items():
dnlcb.downloaded_pkgs = downloaded_pkgs
repo.cache = 0
remote = pkg.returnSimple('relativepath')
diff --git a/src/report-python/__init__.py b/src/report-python/__init__.py
index 71e2d62..6c75eb1 100644
--- a/src/report-python/__init__.py
+++ b/src/report-python/__init__.py
@@ -236,7 +236,7 @@ def createPythonUnhandledExceptionSignature(**kwargs):
raise AttributeError("missing argument {0}".format(arg))
pd = problem_data()
- for (key, value) in kwargs.iteritems():
+ for (key, value) in kwargs.items():
pd.add(key, value)
product = getProduct()
if product:
diff --git a/src/report-python/libreport-meh-test.py b/src/report-python/libreport-meh-test.py
index 4ef2483..eb1c64f 100644
--- a/src/report-python/libreport-meh-test.py
+++ b/src/report-python/libreport-meh-test.py
@@ -22,10 +22,10 @@ handler = ExceptionHandler(config, intf, ReverseExceptionDump)
handler.install(None)
-print "handler set up, about to divide by zero"
+print("handler set up, about to divide by zero")
zero = 0
-print 1 / zero
+print(1 / zero)
-print "should have crashed"
+print("should have crashed")
--
2.1.0