From 6cd68bf644ab65e4ecf53bfe2f619c5096d445af Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 14 Feb 2022 12:32:47 -0600 Subject: [PATCH] Core: Eliminate compiler warnings on Metadata --- src/App/MetadataPyImp.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/App/MetadataPyImp.cpp b/src/App/MetadataPyImp.cpp index 21c2f7c56b..e88e8d7f3c 100644 --- a/src/App/MetadataPyImp.cpp +++ b/src/App/MetadataPyImp.cpp @@ -332,11 +332,13 @@ PyObject* MetadataPy::getFirstSupportedFreeCADVersion(PyObject*) if (result == App::Meta::Version() || minVersion < result) result = minVersion; } - if (result != App::Meta::Version()) + if (result != App::Meta::Version()) { return Py::new_reference_to(Py::String(result.str())); - else + } + else { Py_INCREF(Py_None); return Py_None; + } } PyObject* MetadataPy::getLastSupportedFreeCADVersion(PyObject*) @@ -353,12 +355,13 @@ PyObject* MetadataPy::getLastSupportedFreeCADVersion(PyObject*) if (result == App::Meta::Version() || maxVersion > result) result = maxVersion; } - if (result != App::Meta::Version()) + if (result != App::Meta::Version()) { return Py::new_reference_to(Py::String(result.str())); - else + } + else { Py_INCREF(Py_None); return Py_None; - + } } PyObject* MetadataPy::getCustomAttributes(const char* /*attr*/) const