diff --git a/debian/changelog b/debian/changelog index 0eb8c34d37..f6ad9248e2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,15 @@ -nuitka (0.5.24.3+ds-1) unstable; urgency=medium +nuitka (0.5.24.4+ds-1) unstable; urgency=medium * New upstream hotfix release. * Better detection of acceptable shared library loads from system paths for standalone tests (Closes: 844902). + -- Kay Hayen Sat, 10 Dec 2016 12:25:35 +0100 + +nuitka (0.5.24.3+ds-1) unstable; urgency=medium + + * New upstream hotfix release. + -- Kay Hayen Fri, 09 Dec 2016 06:50:55 +0100 nuitka (0.5.24.2+ds-1) unstable; urgency=medium diff --git a/nuitka/Options.py b/nuitka/Options.py index 8fffdb81ee..2721eeb218 100644 --- a/nuitka/Options.py +++ b/nuitka/Options.py @@ -18,7 +18,7 @@ """ Options module """ version_string = """\ -Nuitka V0.5.24.3 +Nuitka V0.5.24.4 Copyright (C) 2016 Kay Hayen.""" import logging diff --git a/nuitka/build/include/nuitka/helper/raising.h b/nuitka/build/include/nuitka/helper/raising.h index 4a9e8bb9d9..eade16a8ad 100644 --- a/nuitka/build/include/nuitka/helper/raising.h +++ b/nuitka/build/include/nuitka/helper/raising.h @@ -144,9 +144,9 @@ NUITKA_MAY_BE_UNUSED static void RAISE_EXCEPTION_WITH_TYPE( PyObject **exception } else { + PyErr_Format( PyExc_TypeError, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE, Py_TYPE( *exception_type )->tp_name ); Py_DECREF( *exception_type ); - PyErr_Format( PyExc_TypeError, WRONG_EXCEPTION_TYPE_ERROR_MESSAGE, Py_TYPE( *exception_type )->tp_name ); FETCH_ERROR_OCCURRED( exception_type, exception_value, exception_tb ); return; } diff --git a/nuitka/codegen/ConditionalCodes.py b/nuitka/codegen/ConditionalCodes.py index 0e499bf913..c91056a64f 100644 --- a/nuitka/codegen/ConditionalCodes.py +++ b/nuitka/codegen/ConditionalCodes.py @@ -37,17 +37,7 @@ def generateConditionCode(condition, emit, context): # The complexity is needed to avoid unnecessary complex generated C++ # pylint: disable=R0914,R0915 - if condition.isExpressionConstantRef(): - # TODO: Must not happen, optimization catches this. - assert False - - value = condition.getConstant() - - if value: - getGotoCode(context.getTrueBranchTarget(), emit) - else: - getGotoCode(context.getFalseBranchTarget(), emit) - elif condition.isExpressionComparison(): + if condition.isExpressionComparison(): left_name = context.allocateTempName("compare_left") generateExpressionCode( @@ -196,6 +186,12 @@ def generateConditionCode(condition, emit, context): ) context.setCurrentSourceCodeReference(old_source_ref) + elif condition.isCompileTimeConstant(): + getBranchingCode( + condition = "1" if condition.getCompileTimeConstant() else "0", + emit = emit, + context = context + ) else: condition_name = context.allocateTempName("cond_value") truth_name = context.allocateTempName("cond_truth", "int") diff --git a/nuitka/codegen/templates/CodeTemplatesGeneratorFunction.py b/nuitka/codegen/templates/CodeTemplatesGeneratorFunction.py index 28d715a6e1..3460dad9f3 100644 --- a/nuitka/codegen/templates/CodeTemplatesGeneratorFunction.py +++ b/nuitka/codegen/templates/CodeTemplatesGeneratorFunction.py @@ -68,19 +68,12 @@ return; function_return_exit: -#if PYTHON_VERSION >= 330 - if ( tmp_return_value != Py_None ) - { - PyObject *args[1] = { tmp_return_value }; - PyObject *stop_value = CALL_FUNCTION_WITH_ARGS1( PyExc_StopIteration, args ); - RESTORE_ERROR_OCCURRED( PyExc_StopIteration, stop_value, NULL ); - Py_INCREF( PyExc_StopIteration ); - } - else - { - Py_DECREF( tmp_return_value ); - } +#if PYTHON_VERSION < 330 + RESTORE_ERROR_OCCURRED( PyExc_StopIteration, NULL, NULL ); +#else + RESTORE_ERROR_OCCURRED( PyExc_StopIteration, tmp_return_value, NULL ); #endif + Py_INCREF( PyExc_StopIteration ); generator->m_yielded = NULL; return; """