Skip to content

Commit

Permalink
Fix for removing DeprecationWarning (#105)
Browse files Browse the repository at this point in the history
* Fix for removing `DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc'`.
  • Loading branch information
mindflayer authored Feb 3, 2020
1 parent 9b619cd commit 7537d67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mocket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

__all__ = ("mocketize", "Mocket", "MocketEntry", "Mocketizer")

__version__ = "3.8.1"
__version__ = "3.8.2"
2 changes: 2 additions & 0 deletions mocket/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

PY2 = sys.version_info[0] == 2
if PY2:
import collections as collections_abc
from BaseHTTPServer import BaseHTTPRequestHandler
from urlparse import urlsplit, parse_qs, unquote

Expand All @@ -29,6 +30,7 @@ def unquote_utf8(qs):
FileNotFoundError = IOError
BlockingIOError = sock_error
else:
import collections.abc as collections_abc
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlsplit, parse_qs, unquote as unquote_utf8

Expand Down
3 changes: 2 additions & 1 deletion mocket/mocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
JSONDecodeError,
basestring,
byte_type,
collections_abc,
decode_from_bytes,
encode_to_bytes,
text_type,
Expand Down Expand Up @@ -543,7 +544,7 @@ def __init__(self, location, responses):
self.location = location
self.response_index = 0

if not isinstance(responses, collections.Iterable) or isinstance(
if not isinstance(responses, collections_abc.Iterable) or isinstance(
responses, basestring
):
responses = [responses]
Expand Down

0 comments on commit 7537d67

Please sign in to comment.