Skip to content

Commit

Permalink
Merge pull request #258 from mailgun/feat/py310-compatiblity
Browse files Browse the repository at this point in the history
feat(python): update collections import for 3.10
  • Loading branch information
horkhe authored Feb 22, 2023
2 parents 2bb021e + 590f9d9 commit 551813c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions flanker/addresslib/drivers/dns_lookup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import collections
import dnsq
import sys
if sys.version_info.major == 3 and sys.version_info.minor >= 10:
from collections.abc import MutableMapping
else:
from collections import MutableMapping


class DNSLookup(collections.MutableMapping):
class DNSLookup(MutableMapping):
"""
DNSLookup has the same interface as a dict, but talks to a DNS server
"""
Expand Down
8 changes: 6 additions & 2 deletions flanker/addresslib/drivers/redis_driver.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import collections
import os
import redis
import sys

if sys.version_info.major == 3 and sys.version_info.minor >= 10:
from collections.abc import MutableMapping
else:
from collections import MutableMapping

class RedisCache(collections.MutableMapping):
class RedisCache(MutableMapping):
"""
RedisCache has the same interface as a dict, but talks to a redis server.
"""
Expand Down

0 comments on commit 551813c

Please sign in to comment.