Skip to content

Commit d74c3f1

Browse files
committed
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.
1 parent 6497561 commit d74c3f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

socks.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@
5555
"""
5656

5757
from base64 import b64encode
58-
from collections import Callable
58+
try:
59+
from collections.abc import Callable
60+
except ImportError:
61+
from collections import Callable
5962
from errno import EOPNOTSUPP, EINVAL, EAGAIN
6063
import functools
6164
from io import BytesIO

0 commit comments

Comments
 (0)