Blob Blame History Raw
From d74c3f1d34d07a001656453823a153ea0c865449 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
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