File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ install_requires =
53
53
pytz
54
54
requests >= 1.0.0
55
55
six
56
- importlib_resources
56
+ importlib_resources; python_version<'3.7'
57
57
xmlschema >= 1.2.1
58
58
59
59
Original file line number Diff line number Diff line change 9
9
import os
10
10
import re
11
11
import six
12
+ import sys
12
13
from uuid import uuid4 as gen_random_key
13
14
from time import mktime
14
15
from tempfile import NamedTemporaryFile
15
16
from subprocess import Popen
16
17
from subprocess import PIPE
17
- from importlib_resources import path as _resource_path
18
18
19
19
from OpenSSL import crypto
20
20
59
59
from saml2 .xml .schema import node_to_schema
60
60
from saml2 .xml .schema import XMLSchemaError
61
61
62
+ # importlib.resources was introduced in python 3.7
63
+ if sys .version_info [:2 ] >= (3 , 7 ):
64
+ from importlib .resources import path as _resource_path
65
+ else :
66
+ from importlib_resources import path as _resource_path
62
67
63
68
logger = logging .getLogger (__name__ )
64
69
Original file line number Diff line number Diff line change 1
- from importlib_resources import path as _resource_path
1
+ import sys
2
2
3
3
from xmlschema import XMLSchema as _XMLSchema
4
4
from xmlschema .exceptions import XMLSchemaException as XMLSchemaError
5
5
6
6
import saml2 .data .schemas as _data_schemas
7
7
8
+ # importlib.resources was introduced in python 3.7
9
+ if sys .version_info [:2 ] >= (3 , 7 ):
10
+ from importlib .resources import path as _resource_path
11
+ else :
12
+ from importlib_resources import path as _resource_path
8
13
9
14
def _create_xml_schema_validator (source , ** kwargs ):
10
15
kwargs = {
You can’t perform that action at this time.
0 commit comments