rpyutils.add_dll_directories module

rpyutils.add_dll_directories.add_dll_directories_from_env(env_name: str)

Add a list of directories from an environment variable to the DLL search path on Windows.

Each directory in the environment variable that exists is passed to os.add_dll_directory().

If this function is called on a system other than Windows, then nothing happens and an empty list is returned. If this function is called with a version of Python less than 3.8, then nothing happens and an empty list is returned.

Example usage:

with add_dll_directories_from_env('PATH'):
    importlib.import_module('foo', package='bar')
Parameters:

env_name – The name of the environment variable with DLL search paths.

Returns:

A list of handles to directories.