Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __new__(cls, *args, **kwargs):
# Get all coros of this the abstract class
parent_abstract_coros = inspect.getmembers(
AbstractOpenIdConnectManager, predicate=inspect.iscoroutinefunction
)
# Ensure all relevant child methods are implemented as coros
for coro in parent_abstract_coros:
coro_name = coro[0]
child_method = getattr(cls, coro_name)
if not inspect.iscoroutinefunction(child_method):
raise RuntimeError(f"{child_method} must be a coroutine")
# Resume with normal behavior of a Python constructor
return super(AbstractOpenIdConnectManager, cls).__new__(cls)
def __new__(cls, *args, **kwargs):
# Get all coros of this the abstract class
parent_abstract_coros = inspect.getmembers(
AbstractOpenIdConnectManager, predicate=inspect.iscoroutinefunction
)
# Ensure all relevant child methods are implemented as coros
for coro in parent_abstract_coros:
coro_name = coro[0]
child_method = getattr(cls, coro_name)
if not inspect.iscoroutinefunction(child_method):
raise RuntimeError(f"{child_method} must be a coroutine")
# Resume with normal behavior of a Python constructor
return super(AbstractOpenIdConnectManager, cls).__new__(cls)