Skip to content

Commit

Permalink
Enforce passing in an instance of the aiohttp resolver, not a class (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Forbes committed Dec 14, 2021
1 parent f269b8e commit 4dff809
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions aiobotocore/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import copy
import inspect

import botocore.client
from botocore.exceptions import ParamValidationError
Expand Down Expand Up @@ -55,9 +54,9 @@ def _validate_connector_args(connector_args):
report='{} must be an SSLContext instance'.format(k))
elif k == "resolver":
from aiohttp.abc import AbstractResolver
if not inspect.isclass(v) or not issubclass(v, AbstractResolver):
if not isinstance(v, AbstractResolver):
raise ParamValidationError(
report='{} must be an AbstractResolver subclass'.format(k))
report='{} must be an instance of a AbstractResolver'.format(k))
else:
raise ParamValidationError(
report='invalid connector_arg:{}'.format(k))
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_connector_args():

# Test valid config:
AioConfig({
"resolver": aiohttp.resolver.DefaultResolver
"resolver": aiohttp.resolver.DefaultResolver()
})

# test merge
Expand Down

0 comments on commit 4dff809

Please sign in to comment.