Gui: fix SelectionSingleton::sHasSelection

This commit is contained in:
wmayer
2023-11-24 11:40:15 +01:00
committed by wwmayer
parent 7c11ad0fb6
commit 021e0a192f
2 changed files with 7 additions and 1 deletions

View File

@@ -2428,7 +2428,7 @@ PyObject *SelectionSingleton::sHasSelection(PyObject * /*self*/, PyObject *args)
{
const char *doc = nullptr;
int resolve = 0;
if (!PyArg_ParseTuple(args, "|sO!", &doc, &resolve))
if (!PyArg_ParseTuple(args, "|si", &doc, &resolve))
return nullptr;
PY_TRY {

View File

@@ -475,6 +475,12 @@ class DocumentBasicCases(unittest.TestCase):
self.Doc.removeObject(obj.Name)
del obj
def testHasSelection(self):
if FreeCAD.GuiUp:
import FreeCADGui
self.assertFalse(FreeCADGui.Selection.hasSelection("", 1))
def testPropertyLink_Issue2902Part1(self):
o1 = self.Doc.addObject("App::FeatureTest", "test1")
o2 = self.Doc.addObject("App::FeatureTest", "test2")