Skip to content

Commit

Permalink
Bim remove py2 compatibility code (FreeCAD#17229)
Browse files Browse the repository at this point in the history
* BIM: remove py2 compatibility code

* remove unused six from conda environments
  • Loading branch information
adrianinsaval authored Oct 14, 2024
1 parent d4173be commit facd8ca
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion conda/environment-qt6.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ dependencies:
- python==3.12.*
- pyyaml
- qt6-main
- six
- smesh
- swig
- vtk==9.2.6
Expand Down
1 change: 0 additions & 1 deletion conda/environment.devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ dependencies:
- python==3.11.*
- pyyaml
- qt-main
- six
- smesh
- swig
- vtk==9.2.6
Expand Down
16 changes: 3 additions & 13 deletions src/Mod/BIM/bimcommands/BimIfcExplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,20 +566,10 @@ def addProperties(self, eid, parent):
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"
Expand Down

0 comments on commit facd8ca

Please sign in to comment.