build 190929. jointctrl cab control animation tweak, vehicle attachment support fixes, axle clatter fix, python module error logging fix

This commit is contained in:
tmj-fstate
2019-09-30 14:53:47 +02:00
parent e56702cded
commit 0e62593121
4 changed files with 29 additions and 23 deletions

View File

@@ -192,8 +192,7 @@ auto python_taskqueue::run_file( std::string const &File, std::string const &Pat
if( lookup.first.empty() ) { return false; }
std::ifstream inputfile { lookup.first + lookup.second };
std::string input;
input.assign( std::istreambuf_iterator<char>( inputfile ), std::istreambuf_iterator<char>() );
std::string const input { std::istreambuf_iterator<char>( inputfile ), std::istreambuf_iterator<char>() };
if( PyRun_SimpleString( input.c_str() ) != 0 ) {
error();
@@ -215,7 +214,7 @@ void python_taskqueue::release_lock() {
PyEval_SaveThread();
}
auto python_taskqueue::fetch_renderer( std::string const Renderer ) ->PyObject * {
auto python_taskqueue::fetch_renderer( std::string const Renderer ) -> PyObject * {
auto const lookup { m_renderers.find( Renderer ) };
if( lookup != std::end( m_renderers ) ) {
@@ -296,7 +295,9 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, thr
{
// execute python code
task->run();
error();
if( PyErr_Occurred() != nullptr ) {
error();
}
}
// clear the thread state
PyEval_SaveThread();
@@ -318,8 +319,6 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, thr
void
python_taskqueue::error() {
if( PyErr_Occurred() == nullptr ) { return; }
if( m_stderr != nullptr ) {
// std err pythona jest buforowane
PyErr_Print();