Skip to content

Commit

Permalink
Merge bfde494 into d8f9219
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalHaluza committed Aug 30, 2021
2 parents d8f9219 + bfde494 commit bf5927c
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/cdn_definitions/_impl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@

import requests
import yaml
from urllib3.util.retry import Retry

# Requests module historically (>=0.8.0) bundled its own urllib3,
# however it may depend on how the module is installed, as some
# distributions (e.g. RHEL-7) ship the same version of requests
# module without bundled urllib3 and add a compat layer aliasing
# requests.packages.urllib3 to non-bundled urllib3.
# New versions (>=2.16) of the requests module stopped bundling
# urllib3 and added a different backwards-compat layer to retain
# requests.packages.* imports, however that layer is nontransparent
# to static analyzers such as pylint, hence the disable=import-error
# annotation even though the actual import still works.
from requests.packages.urllib3.util.retry import Retry # pylint: disable=import-error


def parsed(data, ext):
Expand Down Expand Up @@ -98,9 +109,8 @@ def load_schema():
Returns:
The cdn-definitions schema, coerced into a Python object.
"""
with open(
os.path.join(os.path.dirname(os.path.dirname(__file__)), "schema.json")
) as schema:
schema_filename = os.path.join(os.path.dirname(__file__), "../schema.json")
with open(schema_filename) as schema: # pylint: disable=unspecified-encoding
return json.load(schema)


Expand Down

0 comments on commit bf5927c

Please sign in to comment.