Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _strpath(p):
if hasattr(p, '__fspath__'):
return p.__fspath__()
elif isinstance(p, Path):
return str(p)
return p