Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _safe_wrapper(name, *args, **kwargs):
with sys_pipes():
if not hasattr(_lib, name):
raise RuntimeError(f"Function {name} not in library")
if getattr(_lib, name)(*args, **kwargs):
raise RuntimeError(f"Function {name} call failed")