Skip to content

Commit

Permalink
Import MutableMapping from collections.abc, except on legacy Python
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Viktorin committed Jun 5, 2020
1 parent 6f2a45d commit b1b3b5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Lib/ldap/cidict.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
See https://www.python-ldap.org/ for details.
"""
from collections import MutableMapping
import warnings

from ldap.compat import MutableMapping
from ldap import __version__


Expand Down
2 changes: 2 additions & 0 deletions Lib/ldap/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from urllib import unquote as urllib_unquote
from urllib import urlopen
from urlparse import urlparse
from collections import MutableMapping

def unquote(uri):
"""Specialized unquote that uses UTF-8 for parsing."""
Expand All @@ -33,6 +34,7 @@ def unquote(uri):
IterableUserDict = UserDict
from urllib.parse import quote, quote_plus, unquote, urlparse
from urllib.request import urlopen
from collections.abc import MutableMapping

def reraise(exc_type, exc_value, exc_traceback):
"""Re-raise an exception given information from sys.exc_info()
Expand Down
4 changes: 1 addition & 3 deletions Lib/ldapurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
'LDAPUrlExtension','LDAPUrlExtensions','LDAPUrl'
]

from collections import MutableMapping

from ldap.compat import quote, unquote
from ldap.compat import quote, unquote, MutableMapping

LDAP_SCOPE_BASE = 0
LDAP_SCOPE_ONELEVEL = 1
Expand Down

0 comments on commit b1b3b5a

Please sign in to comment.