summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-06-02 18:25:52 +0200
committerMichał Górny <mgorny@gentoo.org>2021-06-02 18:26:33 +0200
commit7636ae1dea275d4302aafea4c7016917543264b8 (patch)
treeeda47a146f894dc209cc1d87aa4010201cb0aed6 /dev-python
parentdev-python/betamax: Enable py3.10 (diff)
downloadgentoo-7636ae1dea275d4302aafea4c7016917543264b8.tar.gz
gentoo-7636ae1dea275d4302aafea4c7016917543264b8.tar.bz2
gentoo-7636ae1dea275d4302aafea4c7016917543264b8.zip
dev-python/requests-toolbelt: Enable py3.10
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch37
-rw-r--r--dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild4
2 files changed, 40 insertions, 1 deletions
diff --git a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch
new file mode 100644
index 000000000000..182e413158cd
--- /dev/null
+++ b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch
@@ -0,0 +1,37 @@
+From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001
+From: Jon Dufresne <jon.dufresne@gmail.com>
+Date: Fri, 1 Feb 2019 16:30:01 -0800
+Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils
+
+Warning appears as:
+
+tests/test_downloadutils.py::test_stream_response_to_specific_filename
+ requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
+ if path and isinstance(getattr(path, 'write', None), collections.Callable):
+---
+ requests_toolbelt/downloadutils/stream.py | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/requests_toolbelt/downloadutils/stream.py b/requests_toolbelt/downloadutils/stream.py
+index eed60a7..1d1c31b 100644
+--- a/requests_toolbelt/downloadutils/stream.py
++++ b/requests_toolbelt/downloadutils/stream.py
+@@ -1,6 +1,5 @@
+ # -*- coding: utf-8 -*-
+ """Utilities for dealing with streamed requests."""
+-import collections
+ import os.path
+ import re
+
+@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, chunksize=_DEFAULT_CHUNKSIZE):
+ pre_opened = False
+ fd = None
+ filename = None
+- if path and isinstance(getattr(path, 'write', None), collections.Callable):
++ if path and callable(getattr(path, 'write', None)):
+ pre_opened = True
+ fd = path
+ filename = getattr(fd, 'name', None)
+--
+2.31.1
+
diff --git a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
index dd4056a4fc3b..afbd3421e3a3 100644
--- a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
+++ b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
+PYTHON_COMPAT=( python3_{7..10} pypy3 )
inherit distutils-r1
@@ -36,6 +36,8 @@ PATCHES=(
# disable tests that require internet access
"${FILESDIR}/requests-toolbelt-0.9.1-tests-internet.patch"
+
+ "${FILESDIR}/requests-toolbelt-0.9.1-py310.patch"
)
distutils_enable_tests pytest