Skip to main content

extend_sys_path

Context manager to temporarily add paths to sys.path.

def extend_sys_path(
*paths: str
) - > contextmanager

Context manager to temporarily add paths to sys.path.

Parameters

NameTypeDescription
*pathsstrOne or more directory paths to be appended to the system search path for the duration of the context

Returns

TypeDescription
contextmanagerA context manager that restores the original sys.path state upon exiting the with-block