mirror of
https://github.com/solero/houdini.git
synced 2024-11-12 13:48:20 +00:00
Check if converter is a class before trying to instantiate it
This commit is contained in:
parent
03a22a28b7
commit
dbf7e4d35e
@ -472,10 +472,11 @@ def get_converter(component):
|
|||||||
|
|
||||||
|
|
||||||
async def do_conversion(converter, ctx):
|
async def do_conversion(converter, ctx):
|
||||||
if not isinstance(converter, IConverter) and issubclass(converter, IConverter):
|
if inspect.isclass(converter):
|
||||||
converter = converter()
|
if not isinstance(converter, IConverter) and issubclass(converter, IConverter):
|
||||||
if isinstance(converter, IConverter):
|
converter = converter()
|
||||||
if asyncio.iscoroutinefunction(converter.convert):
|
if isinstance(converter, IConverter):
|
||||||
return await converter.convert(ctx)
|
if asyncio.iscoroutinefunction(converter.convert):
|
||||||
return converter.convert(ctx)
|
return await converter.convert(ctx)
|
||||||
|
return converter.convert(ctx)
|
||||||
return converter(ctx.argument)
|
return converter(ctx.argument)
|
||||||
|
Loading…
Reference in New Issue
Block a user