From 2f05f86f6c3be9231dff1b481eb485b7764fe6d5 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 29 Jun 2021 15:21:56 +0200 Subject: [PATCH] Draft: Fix incorrect use of `in` operator Looking at the surrounding code, this should be `==` rather than `in`. The code does work as intended, because a string is always a substring of itself, but better to fix it anyway. Seems this was broken since this code was first introduced in commit 193339991f (Draft: clean up ViewProviderLabel class) --- src/Mod/Draft/draftviewproviders/view_label.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Draft/draftviewproviders/view_label.py b/src/Mod/Draft/draftviewproviders/view_label.py index 0238363287..571b40e000 100644 --- a/src/Mod/Draft/draftviewproviders/view_label.py +++ b/src/Mod/Draft/draftviewproviders/view_label.py @@ -394,7 +394,7 @@ class ViewProviderLabel(ViewProviderDraftAnnotation): if s: self.arrowpos.scaleFactor.setValue((s, s, s)) - elif prop in "Justification" and "Justification" in properties: + elif prop == "Justification" and "Justification" in properties: if vobj.Justification == "Left": self.text2d.justification = coin.SoText2.LEFT self.text3d.justification = coin.SoAsciiText.LEFT