Draft: gui_utils.py fix error in select function (#19539)

* Draft: gui_utils.py fix error in select function

PR #18795 changed the select function to also handle tuples. This PR adds a check to ensure the referenced objects in the tuple still exist before calling `Gui.Selection.addSelection()`.
This commit is contained in:
Roy-043
2025-02-13 16:00:30 +01:00
committed by GitHub
parent 9fccfa115d
commit ee7f52060b
2 changed files with 17 additions and 5 deletions

View File

@@ -389,6 +389,14 @@ def tolerance():
return 10 ** -precision()
def is_deleted(obj):
"""Return `True` if obj is deleted."""
try:
return not obj.isAttachedToDocument()
except:
return True
def get_real_name(name):
"""Strip the trailing numbers from a string to get only the letters.