Merge pull request #5131 from freqtrade/dependabot/pip/develop/mypy-0.902
Bump mypy from 0.812 to 0.902
This commit is contained in:
@@ -58,6 +58,9 @@ class IResolver:
|
||||
# Generate spec based on absolute path
|
||||
# Pass object_name as first argument to have logging print a reasonable name.
|
||||
spec = importlib.util.spec_from_file_location(object_name or "", str(module_path))
|
||||
if not spec:
|
||||
return iter([None])
|
||||
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
try:
|
||||
spec.loader.exec_module(module) # type: ignore # importlib does not use typehints
|
||||
|
@@ -77,14 +77,13 @@ class Webhook(RPCHandler):
|
||||
def _send_msg(self, payload: dict) -> None:
|
||||
"""do the actual call to the webhook"""
|
||||
|
||||
if self._format == 'form':
|
||||
kwargs = {'data': payload}
|
||||
elif self._format == 'json':
|
||||
kwargs = {'json': payload}
|
||||
else:
|
||||
raise NotImplementedError('Unknown format: {}'.format(self._format))
|
||||
|
||||
try:
|
||||
post(self._url, **kwargs)
|
||||
if self._format == 'form':
|
||||
post(self._url, data=payload)
|
||||
elif self._format == 'json':
|
||||
post(self._url, json=payload)
|
||||
else:
|
||||
raise NotImplementedError('Unknown format: {}'.format(self._format))
|
||||
|
||||
except RequestException as exc:
|
||||
logger.warning("Could not call webhook url. Exception: %s", exc)
|
||||
|
Reference in New Issue
Block a user