Skip to content

Commit

Permalink
Fixed linter error
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Crespo committed Nov 13, 2018
1 parent 5161825 commit f1a0a42
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/service-library/src/servicelib/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
from pathlib import Path
from typing import Dict, Tuple

import openapi_core
import yaml

import openapi_core
from aiohttp import ClientSession
from openapi_core.schema.exceptions import \
OpenAPIError # pylint: disable=W0611
from openapi_core.schema.exceptions import OpenAPIMappingError
from openapi_core.schema.exceptions import OpenAPIError, OpenAPIMappingError # pylint: disable=W0611
from openapi_core.schema.specs.models import Spec
from yarl import URL

Expand All @@ -33,7 +32,8 @@ def load_from_path(filepath: Path) -> Tuple[Dict, str]:


async def load_from_url(url: URL) -> Tuple[Dict, str]:
async with ClientSession() as session:
TIMEOUT_SECS = 5*60
async with ClientSession(timeout=TIMEOUT_SECS) as session:
async with session.get(url) as resp:
spec_dict = yaml.safe_load(resp.content)
return spec_dict, str(url)
Expand Down

0 comments on commit f1a0a42

Please sign in to comment.