Keep pkg_resources import function-local (~0.06s)
This commit is contained in:
parent
1fbf76b95a
commit
e2af07df44
@ -20,7 +20,6 @@ import six
|
||||
from six.moves.urllib.parse import parse_qs, urlparse
|
||||
|
||||
import xmltodict
|
||||
from pkg_resources import resource_filename
|
||||
from werkzeug.exceptions import HTTPException
|
||||
|
||||
import boto3
|
||||
@ -766,6 +765,9 @@ class AWSServiceSpec(object):
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
# Importing pkg_resources takes ~60ms; keep it local
|
||||
from pkg_resources import resource_filename # noqa
|
||||
|
||||
self.path = resource_filename("botocore", path)
|
||||
with io.open(self.path, "r", encoding="utf-8") as f:
|
||||
spec = json.load(f)
|
||||
|
Loading…
Reference in New Issue
Block a user