From 7d52617bfd6ea230ac47f36d9d113deab27c4e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Insaurralde=20Avalos?= <36372335+adrianinsaval@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:25:14 -0300 Subject: [PATCH] Bim remove py2 compatibility code (#17229) * BIM: remove py2 compatibility code * remove unused six from conda environments --- conda/environment-qt6.devenv.yml | 1 - conda/environment.devenv.yml | 1 - src/Mod/BIM/bimcommands/BimIfcExplorer.py | 16 +++------------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/conda/environment-qt6.devenv.yml b/conda/environment-qt6.devenv.yml index 6f44acd7de..a2c541042d 100644 --- a/conda/environment-qt6.devenv.yml +++ b/conda/environment-qt6.devenv.yml @@ -92,7 +92,6 @@ dependencies: - python==3.12.* - pyyaml - qt6-main -- six - smesh - swig - vtk==9.2.6 diff --git a/conda/environment.devenv.yml b/conda/environment.devenv.yml index 20c93e576b..30ae7569dc 100644 --- a/conda/environment.devenv.yml +++ b/conda/environment.devenv.yml @@ -92,7 +92,6 @@ dependencies: - python==3.11.* - pyyaml - qt-main -- six - smesh - swig - vtk==9.2.6 diff --git a/src/Mod/BIM/bimcommands/BimIfcExplorer.py b/src/Mod/BIM/bimcommands/BimIfcExplorer.py index 6d784b88d6..829ca4d1cb 100644 --- a/src/Mod/BIM/bimcommands/BimIfcExplorer.py +++ b/src/Mod/BIM/bimcommands/BimIfcExplorer.py @@ -566,20 +566,10 @@ class BIM_IfcExplorer: self.addAttributes(prop.id(), subitem) def tostr(self, text): - "resolves py2/py3 string representation hassles" - - import six - - if six.PY2: - if isinstance(text, unicode): - return text.encode("utf8") - else: - return str(text) + if isinstance(text, str): + return text else: - if isinstance(text, str): - return text - else: - return str(text) + return str(text) def onSelectTree(self, item, previous): "displays attributes and properties of a tree item"