prepend PWD to PYTHONPATH
This commit is contained in:
@ -371,7 +371,19 @@ static void setupPyPath(void)
|
||||
Py_XDECREF(mod);
|
||||
|
||||
if(path) {
|
||||
PyObject *cur;
|
||||
char cwd[PATH_MAX];
|
||||
|
||||
insertDefaultPath(path);
|
||||
|
||||
/* prepend current directory */
|
||||
if(getcwd(cwd, sizeof(cwd)-1)) {
|
||||
cwd[sizeof(cwd)-1] = '\0';
|
||||
cur = PyString_FromString(cwd);
|
||||
if(cur)
|
||||
PyList_Insert(path, 0, cur);
|
||||
Py_XDECREF(cur);
|
||||
}
|
||||
}
|
||||
Py_XDECREF(path);
|
||||
}
|
||||
|
@ -27,9 +27,10 @@ PYTHONPATH
|
||||
|
||||
The interpreter search path is automatically prefixed with the following additional paths:
|
||||
|
||||
* ``$(EPICS_BASE)/python<PY_VER>/$(EPICS_ARCH)``
|
||||
* ``$(PYDEV_BASE)/python<PY_VER>/$(EPICS_ARCH)``
|
||||
* ``${PWD}``
|
||||
* ``$(TOP)/python<PY_VER>/$(EPICS_ARCH)``
|
||||
* ``$(PYDEV_BASE)/python<PY_VER>/$(EPICS_ARCH)``
|
||||
* ``$(EPICS_BASE)/python<PY_VER>/$(EPICS_ARCH)``
|
||||
|
||||
The environment variables ``EPICS_BASE``, ``PYDEV_BASE``, ``TOP``, and ``EPICS_ARCH``
|
||||
will be used if set. Compile time defaults are selected for
|
||||
|
Reference in New Issue
Block a user