From d618bc4f1b7988eeded890c3f00a9d0c7c6d749f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Tue, 13 Dec 2016 15:18:53 +0100 Subject: [PATCH] fix building against python 3.6 Signed-off-by: Igor Gnatenko --- ...ts-catch-ModuleNotFoundError-as-well.patch | 31 +++++++++++++++++++ dnf.spec | 4 ++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-tests-catch-ModuleNotFoundError-as-well.patch diff --git a/0001-tests-catch-ModuleNotFoundError-as-well.patch b/0001-tests-catch-ModuleNotFoundError-as-well.patch new file mode 100644 index 0000000..d72b5dc --- /dev/null +++ b/0001-tests-catch-ModuleNotFoundError-as-well.patch @@ -0,0 +1,31 @@ +From 51a1694d7c5dc2a9276ba21678cf8560d90ecfe5 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Tue, 13 Dec 2016 14:54:29 +0100 +Subject: [PATCH] tests: catch ModuleNotFoundError as well + +From What's New in Python 3.6: +Import now raises the new exception ModuleNotFoundError (subclass of ImportError) +when it cannot find a module. Code that currently checks for +ImportError (in try-except) will still work. (Contributed by Eric Snow in issue 15767.) + +Signed-off-by: Igor Gnatenko +--- + tests/test_plugin.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/test_plugin.py b/tests/test_plugin.py +index 23a95c33..88e51719 100644 +--- a/tests/test_plugin.py ++++ b/tests/test_plugin.py +@@ -93,6 +93,6 @@ class PluginNonExistentTest(tests.support.TestCase): + with tests.support.wiretap_logs('dnf', dnf.logging.SUBDEBUG, stream): + dnf.plugin._import_modules(package, ('nonexistent.py',)) + +- end = ('ImportError: No module named \'testpkg\'\n' if dnf.pycomp.PY3 +- else 'ImportError: No module named testpkg.nonexistent\n') ++ end = ('Error: No module named \'testpkg\'\n' if dnf.pycomp.PY3 ++ else 'Error: No module named testpkg.nonexistent\n') + self.assertTracebackIn(end, stream.getvalue()) +-- +2.11.0 + diff --git a/dnf.spec b/dnf.spec index 8f8957b..1f44a8f 100644 --- a/dnf.spec +++ b/dnf.spec @@ -25,7 +25,7 @@ Name: dnf Version: 2.0.0 -Release: 0.rc2.5%{?dist} +Release: 0.rc2.6%{?dist} Summary: Package manager forked from Yum, using libsolv as a dependency resolver # For a breakdown of the licensing, see PACKAGE-LICENSING License: GPLv2+ and GPLv2 and GPL @@ -33,6 +33,8 @@ URL: https://github.com/rpm-software-management/dnf Source0: %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz # https://bugzilla.redhat.com/show_bug.cgi?id=1380945 Patch666: 0001-Revert-group-treat-mandatory-pkgs-as-mandatory-if-st.patch +# https://github.com/rpm-software-management/dnf/pull/686 +Patch777: 0001-tests-catch-ModuleNotFoundError-as-well.patch BuildArch: noarch BuildRequires: cmake BuildRequires: gettext