blob: 905bfa7493a6aeb08f364528f7e61c744a439c17 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# compat.py - backwards compatible optional imports
IMPL_HAS_CRYPTO = True
try:
import cryptography
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives import serialization
except:
IMPL_HAS_CRYPTO = False
cryptography = None
default_backend = None
ec = None
serialization = None
IMPL_HAS_ECE = True
try:
import http_ece
except:
IMPL_HAS_ECE = False
http_ece = None
IMPL_HAS_BLURHASH = True
try:
import blurhash
except:
IMPL_HAS_BLURHASH = False
blurhash = None
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
try:
import magic
except ImportError:
magic = None
try:
from pathlib import PurePath
except:
class PurePath:
pass
|