From b6e8c7e8fb750e44b387557ad19afe2ccfe69f7c Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sat, 27 Feb 2010 07:22:22 +0000 Subject: Add an os.get_exec_path() function to return the list of directories that launching a subprocess will search for the executable. Refactors some code in os._execvpe(). --- Doc/library/os.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Doc') diff --git a/Doc/library/os.rst b/Doc/library/os.rst index d01c8dafeb..05471549bb 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -136,6 +136,17 @@ process and user. These functions are described in :ref:`os-file-dir`. +.. function:: get_exec_path(env=None) + + Returns the list of directories that will be searched for a named + executable, similar to a shell, when launching a process. + *env*, when specified, should be an environment variable dictionary + to lookup the PATH in. + By default, when *env* is None, :data:`environ` is used. + + .. versionadded:: 3.2 + + .. function:: ctermid() Return the filename corresponding to the controlling terminal of the process. -- cgit v1.2.1