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