From 18b5f238ae53e3c19cb6e985f450a098dc0d6d23 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 7 Feb 2019 21:05:09 -0200 Subject: [PATCH] Arch: Fixed py3/encoding bug --- src/Mod/Arch/ArchCommands.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py index 71387ac6f1..24d3d72ac6 100644 --- a/src/Mod/Arch/ArchCommands.py +++ b/src/Mod/Arch/ArchCommands.py @@ -1276,12 +1276,16 @@ def getExtrusionData(shape,sortmethod="area"): def printMessage( message ): FreeCAD.Console.PrintMessage( message ) if FreeCAD.GuiUp : - reply = QtGui.QMessageBox.information( None , "" , message.decode('utf8') ) + if sys.version_info.major < 3: + message = message.decode("utf8") + reply = QtGui.QMessageBox.information( None , "" , message ) def printWarning( message ): FreeCAD.Console.PrintMessage( message ) if FreeCAD.GuiUp : - reply = QtGui.QMessageBox.warning( None , "" , message.decode('utf8') ) + if sys.version_info.major < 3: + message = message.decode("utf8") + reply = QtGui.QMessageBox.warning( None , "" , message ) # command definitions ###############################################