From a8b614cf6f85cd5ba336b9f58332411b9e544075 Mon Sep 17 00:00:00 2001 From: milek7 Date: Wed, 18 Sep 2019 19:18:53 +0200 Subject: [PATCH] fix error reporting of python syntax errors --- CMakeLists.txt | 3 +++ PyInt.cpp | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1731dbe1..058ef574 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/PyInt.cpp b/PyInt.cpp index 6bfe0abe..b92c90ed 100644 --- a/PyInt.cpp +++ b/PyInt.cpp @@ -383,7 +383,8 @@ void python_taskqueue::run( GLFWwindow *Context, rendertask_sequence &Tasks, upl std::lock_guard 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();