From d5ab35638ccc0344767b11ee58a27bb329d27a40 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sun, 11 Nov 2018 11:27:01 -0800 Subject: [PATCH] Add upstream patch to avoid DeprecationWarning. Fixes bug #1648583 --- ...3f1d34d07a001656453823a153ea0c865449.patch | 29 +++++++++++++++++++ python-pysocks.spec | 7 +++-- 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 d74c3f1d34d07a001656453823a153ea0c865449.patch diff --git a/d74c3f1d34d07a001656453823a153ea0c865449.patch b/d74c3f1d34d07a001656453823a153ea0c865449.patch new file mode 100644 index 0000000..604d932 --- /dev/null +++ b/d74c3f1d34d07a001656453823a153ea0c865449.patch @@ -0,0 +1,29 @@ +From d74c3f1d34d07a001656453823a153ea0c865449 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Fri, 29 Jun 2018 18:03:21 +0200 +Subject: [PATCH] Avoid DeprecationWarning + +Using or importing the ABCs from 'collections' instead of from +'collections.abc' is deprecated, and in 3.8 it will stop working. + +Preserves Python 2 compatibility. +--- + socks.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/socks.py b/socks.py +index 1b55295..80b6876 100644 +--- a/socks.py ++++ b/socks.py +@@ -55,7 +55,10 @@ + """ + + from base64 import b64encode +-from collections import Callable ++try: ++ from collections.abc import Callable ++except ImportError: ++ from collections import Callable + from errno import EOPNOTSUPP, EINVAL, EAGAIN + import functools + from io import BytesIO diff --git a/python-pysocks.spec b/python-pysocks.spec index b89ab38..02d5f99 100644 --- a/python-pysocks.spec +++ b/python-pysocks.spec @@ -24,14 +24,14 @@ Name: python-%{modname} Version: 1.6.8 -Release: 5%{?dist} +Release: 6%{?dist} Summary: %{sum} License: BSD URL: https://github.com/Anorov/%{pypi_name} Source0: %pypi_source BuildArch: noarch - +Patch0: https://github.com/Anorov/PySocks/commit/d74c3f1d34d07a001656453823a153ea0c865449.patch %global _description \ A fork of SocksiPy with bug fixes and extra features.\ @@ -171,6 +171,9 @@ rm -rfv test/bin %changelog +* Sun Nov 11 2018 Kevin Fenzi - 1.6.8-6 +- Add upstream patch to avoid DeprecationWarning. Fixes bug #1648583 + * Wed Oct 03 2018 Raphael Groner - 1.6.8-5 - add python3_other subpackage for epel7 - prepare removal of python2 subpackage in Fedora