Skip to content

Commit

Permalink
Fix fetcher_constructor to default to None instead of DefaultFetcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Amstutz committed Dec 6, 2016
1 parent 85acd23 commit b3843eb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions schema_salad/ref_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __init__(self,
idx=None, # type: Dict[unicode, Union[dict, list, unicode]]
cache=None, # type: Dict[unicode, Any]
session=None, # type: requests.sessions.Session
fetcher_constructor=DefaultFetcher # type: Callable[[Dict[unicode, unicode], requests.sessions.Session], Fetcher]
fetcher_constructor=None # type: Callable[[Dict[unicode, unicode], requests.sessions.Session], Fetcher]
):
# type: (...) -> None

Expand Down Expand Up @@ -185,7 +185,10 @@ def __init__(self,
else:
self.session = session

self.fetcher_constructor = fetcher_constructor
if fetcher_constructor:
self.fetcher_constructor = fetcher_constructor
else:
self.fetcher_constructor = DefaultFetcher
self.fetcher = self.fetcher_constructor(self.cache, self.session)

self.fetch_text = self.fetcher.fetch_text
Expand Down

0 comments on commit b3843eb

Please sign in to comment.