From 2f8eded3e386752d401e834efb766993bf896ca9 Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Jan 21 2019 07:57:39 +0000 Subject: Fix python3.7 incompatibility (rhbz#1653869) --- diff --git a/0001-Fix-Python-3.7-compatibility-2978.patch b/0001-Fix-Python-3.7-compatibility-2978.patch new file mode 100644 index 0000000..1904175 --- /dev/null +++ b/0001-Fix-Python-3.7-compatibility-2978.patch @@ -0,0 +1,39 @@ +From 15d44f02a391764da1ce1f239caef819f08beed8 Mon Sep 17 00:00:00 2001 +From: Adrian Sampson +Date: Sun, 22 Jul 2018 12:34:19 -0400 +Subject: [PATCH] Fix Python 3.7 compatibility (#2978) + +--- + beets/autotag/hooks.py | 8 +++++++- + docs/changelog.rst | 2 ++ + 2 files changed, 9 insertions(+), 1 deletion(-) + +diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py +index 3615a93337b8..1c62a54c5c35 100644 +--- a/beets/autotag/hooks.py ++++ b/beets/autotag/hooks.py +@@ -31,6 +31,12 @@ import six + + log = logging.getLogger('beets') + ++# The name of the type for patterns in re changed in Python 3.7. ++try: ++ Pattern = re._pattern_type ++except AttributeError: ++ Pattern = re.Pattern ++ + + # Classes used to represent candidate options. + +@@ -433,7 +439,7 @@ class Distance(object): + be a compiled regular expression, in which case it will be + matched against `value2`. + """ +- if isinstance(value1, re._pattern_type): ++ if isinstance(value1, Pattern): + return bool(value1.match(value2)) + return value1 == value2 + +-- +2.20.1 + diff --git a/beets.spec b/beets.spec index 0f9c8c9..b31260c 100644 --- a/beets.spec +++ b/beets.spec @@ -1,10 +1,11 @@ Name: beets Version: 1.4.7 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Music library manager and MusicBrainz tagger License: MIT and ISC URL: http://beets.io Source0: https://github.com/beetbox/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch0: 0001-Fix-Python-3.7-compatibility-2978.patch BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-sphinx @@ -128,6 +129,9 @@ rm -f docs/_build/html/{.buildinfo,objects.inv} %files doc %doc docs/_build/html docs/_build/text %changelog +* Mon Jan 21 2019 Michele Baldessari - 1.4.7-4 +- Fix python3.7 incompatibility (rhbz#1653869) + * Thu Jul 12 2018 Fedora Release Engineering - 1.4.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild