mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-06 01:57:45 +08:00
more flaky fixes
This commit is contained in:
@@ -97,6 +97,12 @@ void PyDescriptor::parseParameters(const ParametersMap & parameters)
|
||||
|
||||
_import_array();
|
||||
|
||||
// Invalidate importlib's directory-listing caches so a script created
|
||||
// after sys.path was first scanned in this process is still found.
|
||||
// Without this, the second Py* instance pointing at a freshly-written
|
||||
// script in an already-known directory fails with ModuleNotFoundError.
|
||||
PyRun_SimpleString("import importlib; importlib.invalidate_caches()");
|
||||
|
||||
std::string scriptName = uSplit(UFile::getName(path_), '.').front();
|
||||
PyObject * pName = PyUnicode_FromString(scriptName.c_str());
|
||||
UDEBUG("PyImport_Import() beg");
|
||||
|
||||
@@ -46,6 +46,12 @@ PyDetector::PyDetector(const ParametersMap & parameters) :
|
||||
|
||||
_import_array();
|
||||
|
||||
// Invalidate importlib's directory-listing caches so a script created
|
||||
// after sys.path was first scanned in this process is still found. Without
|
||||
// this, the second PyDetector instance pointing at a freshly-written
|
||||
// script in an already-known directory fails with ModuleNotFoundError.
|
||||
PyRun_SimpleString("import importlib; importlib.invalidate_caches()");
|
||||
|
||||
std::string scriptName = uSplit(UFile::getName(path_), '.').front();
|
||||
PyObject * pName = PyUnicode_FromString(scriptName.c_str());
|
||||
UDEBUG("PyImport_Import() beg");
|
||||
|
||||
@@ -53,6 +53,12 @@ PyMatcher::PyMatcher(
|
||||
|
||||
_import_array();
|
||||
|
||||
// Invalidate importlib's directory-listing caches so a script created
|
||||
// after sys.path was first scanned in this process is still found.
|
||||
// Without this, the second Py* instance pointing at a freshly-written
|
||||
// script in an already-known directory fails with ModuleNotFoundError.
|
||||
PyRun_SimpleString("import importlib; importlib.invalidate_caches()");
|
||||
|
||||
std::string scriptName = uSplit(UFile::getName(path_), '.').front();
|
||||
PyObject * pName = PyUnicode_FromString(scriptName.c_str());
|
||||
UDEBUG("PyImport_Import");
|
||||
|
||||
Reference in New Issue
Block a user