diff options
| author | Leo Famulari <leo@famulari.name> | 2018-12-03 17:29:58 -0500 |
|---|---|---|
| committer | Leo Famulari <leo@famulari.name> | 2018-12-03 17:30:30 -0500 |
| commit | c05c1910dbd630304e06020d27d4b72bb0502088 (patch) | |
| tree | 8f8fc3d27aa522120bc05cffaaada15e0a699068 | |
| parent | 91a4863d9d727754d1743f4c0591c63b950494cf (diff) | |
gnu: Beets: Fix compatibility with Python 3.7.
* gnu/packages/patches/beets-python-3.7-fix.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/music.scm (beets)[source]: Use it.
| -rw-r--r-- | gnu/local.mk | 1 | ||||
| -rw-r--r-- | gnu/packages/music.scm | 1 | ||||
| -rw-r--r-- | gnu/packages/patches/beets-python-3.7-fix.patch | 57 |
3 files changed, 59 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 847c9286ccb..53a35475597 100644 --- a/gnu/local.mk +++ b/gnu/local.mk | |||
| @@ -600,6 +600,7 @@ dist_patch_DATA = \ | |||
| 600 | %D%/packages/patches/bash-completion-directories.patch \ | 600 | %D%/packages/patches/bash-completion-directories.patch \ |
| 601 | %D%/packages/patches/bastet-change-source-of-unordered_set.patch \ | 601 | %D%/packages/patches/bastet-change-source-of-unordered_set.patch \ |
| 602 | %D%/packages/patches/bazaar-CVE-2017-14176.patch \ | 602 | %D%/packages/patches/bazaar-CVE-2017-14176.patch \ |
| 603 | %D%/packages/patches/beets-python-3.7-fix.patch \ | ||
| 603 | %D%/packages/patches/beignet-correct-file-names.patch \ | 604 | %D%/packages/patches/beignet-correct-file-names.patch \ |
| 604 | %D%/packages/patches/binutils-loongson-workaround.patch \ | 605 | %D%/packages/patches/binutils-loongson-workaround.patch \ |
| 605 | %D%/packages/patches/blast+-fix-makefile.patch \ | 606 | %D%/packages/patches/blast+-fix-makefile.patch \ |
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index faf5aab09a7..cc6d2280066 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm | |||
| @@ -2692,6 +2692,7 @@ Songs can be searched by artist, name or even by a part of the song text.") | |||
| 2692 | (source (origin | 2692 | (source (origin |
| 2693 | (method url-fetch) | 2693 | (method url-fetch) |
| 2694 | (uri (pypi-uri "beets" version)) | 2694 | (uri (pypi-uri "beets" version)) |
| 2695 | (patches (search-patches "beets-python-3.7-fix.patch")) | ||
| 2695 | (sha256 | 2696 | (sha256 |
| 2696 | (base32 | 2697 | (base32 |
| 2697 | "0l2vfrknwcsm6bn83m7476qrz45qwgxcb5k0h7kn96kr70irn1v2")))) | 2698 | "0l2vfrknwcsm6bn83m7476qrz45qwgxcb5k0h7kn96kr70irn1v2")))) |
diff --git a/gnu/packages/patches/beets-python-3.7-fix.patch b/gnu/packages/patches/beets-python-3.7-fix.patch new file mode 100644 index 00000000000..43707cd9d02 --- /dev/null +++ b/gnu/packages/patches/beets-python-3.7-fix.patch | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | Fix compatibility issue with Python 3.7: | ||
| 2 | |||
| 3 | https://github.com/beetbox/beets/issues/2978 | ||
| 4 | |||
| 5 | Patch copied from upstream source repository: | ||
| 6 | |||
| 7 | https://github.com/beetbox/beets/commit/15d44f02a391764da1ce1f239caef819f08beed8 | ||
| 8 | |||
| 9 | From 15d44f02a391764da1ce1f239caef819f08beed8 Mon Sep 17 00:00:00 2001 | ||
| 10 | From: Adrian Sampson <adrian@radbox.org> | ||
| 11 | Date: Sun, 22 Jul 2018 12:34:19 -0400 | ||
| 12 | Subject: [PATCH] Fix Python 3.7 compatibility (#2978) | ||
| 13 | |||
| 14 | --- | ||
| 15 | beets/autotag/hooks.py | 8 +++++++- | ||
| 16 | docs/changelog.rst | 2 ++ | ||
| 17 | 2 files changed, 9 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py | ||
| 20 | index 3615a9333..1c62a54c5 100644 | ||
| 21 | --- a/beets/autotag/hooks.py | ||
| 22 | +++ b/beets/autotag/hooks.py | ||
| 23 | @@ -31,6 +31,12 @@ | ||
| 24 | |||
| 25 | log = logging.getLogger('beets') | ||
| 26 | |||
| 27 | +# The name of the type for patterns in re changed in Python 3.7. | ||
| 28 | +try: | ||
| 29 | + Pattern = re._pattern_type | ||
| 30 | +except AttributeError: | ||
| 31 | + Pattern = re.Pattern | ||
| 32 | + | ||
| 33 | |||
| 34 | # Classes used to represent candidate options. | ||
| 35 | |||
| 36 | @@ -433,7 +439,7 @@ def _eq(self, value1, value2): | ||
| 37 | be a compiled regular expression, in which case it will be | ||
| 38 | matched against `value2`. | ||
| 39 | """ | ||
| 40 | - if isinstance(value1, re._pattern_type): | ||
| 41 | + if isinstance(value1, Pattern): | ||
| 42 | return bool(value1.match(value2)) | ||
| 43 | return value1 == value2 | ||
| 44 | |||
| 45 | #diff --git a/docs/changelog.rst b/docs/changelog.rst | ||
| 46 | #index be6de2904..d487f31f5 100644 | ||
| 47 | #--- a/docs/changelog.rst | ||
| 48 | #+++ b/docs/changelog.rst | ||
| 49 | #@@ -19,6 +19,8 @@ New features: | ||
| 50 | # | ||
| 51 | # Fixes: | ||
| 52 | # | ||
| 53 | #+* Fix compatibility Python 3.7 and its change to a name in the ``re`` module. | ||
| 54 | #+ :bug:`2978` | ||
| 55 | # * R128 normalization tags are now properly deleted from files when the values | ||
| 56 | # are missing. | ||
| 57 | # Thanks to :user:`autrimpo`. | ||
