Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(python): update collections import for 3.10 #258

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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