mirror of
https://github.com/FlipsideCrypto/web3.py.git
synced 2026-02-06 10:56:47 +00:00
py34 and py27 compat
This commit is contained in:
parent
712fc4c457
commit
782bd7329a
@ -1,5 +1,4 @@
|
||||
import hashlib
|
||||
import collections
|
||||
|
||||
from .types import (
|
||||
is_boolean,
|
||||
@ -13,6 +12,9 @@ from .types import (
|
||||
from .string import (
|
||||
force_bytes,
|
||||
)
|
||||
from .compat import (
|
||||
Generator,
|
||||
)
|
||||
|
||||
|
||||
def generate_cache_key(value):
|
||||
@ -31,7 +33,7 @@ def generate_cache_key(value):
|
||||
for key
|
||||
in sorted(value.keys())
|
||||
))
|
||||
elif is_array(value) or isinstance(value, collections.Generator):
|
||||
elif is_array(value) or isinstance(value, Generator):
|
||||
return generate_cache_key("".join((
|
||||
generate_cache_key(item)
|
||||
for item
|
||||
|
||||
@ -6,11 +6,13 @@ if sys.version_info.major == 2:
|
||||
from .compat_py2 import (
|
||||
urlparse,
|
||||
urlunparse,
|
||||
Generator,
|
||||
)
|
||||
else:
|
||||
from .compat_py3 import ( # noqa: #401
|
||||
urlparse,
|
||||
urlunparse,
|
||||
Generator,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -2,3 +2,4 @@ from urlparse import ( # noqa: F401
|
||||
urlparse,
|
||||
urlunparse,
|
||||
)
|
||||
Generator = type(_ for _ in tuple())
|
||||
|
||||
@ -1,4 +1,8 @@
|
||||
import collections
|
||||
|
||||
from urllib.parse import ( # noqa: F401
|
||||
urlparse,
|
||||
urlunparse,
|
||||
)
|
||||
|
||||
Generator = collections.Generator
|
||||
|
||||
Loading…
Reference in New Issue
Block a user