fix error reporting of python syntax errors

This commit is contained in:
milek7
2019-09-18 19:18:53 +02:00
parent c44c570509
commit a8b614cf6f
2 changed files with 5 additions and 3 deletions

View File

@@ -303,6 +303,9 @@ if (WIN32)
target_link_libraries(${PROJECT_NAME} ws2_32)
endif()
#target_compile_options(${PROJECT_NAME} PRIVATE -flto)
#target_link_libraries(${PROJECT_NAME} -flto)
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${PROJECT_NAME})

View File

@@ -383,7 +383,8 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, upl
std::lock_guard<std::mutex> lock(Upload_Tasks.mutex);
Upload_Tasks.data.push_back(task);
}
error();
if( PyErr_Occurred() != nullptr )
error();
}
// clear the thread state
PyEval_SaveThread();
@@ -415,8 +416,6 @@ void python_taskqueue::update()
void
python_taskqueue::error() {
if( PyErr_Occurred() == nullptr ) { return; }
if( m_stderr != nullptr ) {
// std err pythona jest buforowane
PyErr_Print();