Skip to content

Commit

Permalink
feat(python): update collections import for 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandlittle committed Feb 21, 2023
1 parent 2bb021e commit 590f9d9
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 590f9d9

Please sign in to comment.