# HG changeset patch # User Edouard Tisserant # Date 1685522283 -7200 # Node ID 032bf4f225d095de3fb0b341cab22de09d9fa466 # Parent 56f08ab3a491773537e7a3ba01a1f6cf89693914 Py3 usual encoding, ints and exceptions fixes. diff -r 56f08ab3a491 -r 032bf4f225d0 ProjectController.py --- a/ProjectController.py Tue May 30 13:00:50 2023 +0200 +++ b/ProjectController.py Wed May 31 10:38:03 2023 +0200 @@ -1202,7 +1202,7 @@ LibCFilesAndCFLAGS, LibLDFLAGS, LibExtraFiles = self.GetLibrariesCCode( buildpath) except UserAddressedException as e: - self.logger.write_error(e.message) + self.logger.write_error(str(e)) return False except Exception as e: self.logger.write_error( @@ -1216,7 +1216,7 @@ buildpath, self.PLCGeneratedLocatedVars) except UserAddressedException as e: - self.logger.write_error(e.message) + self.logger.write_error(str(e)) return False except Exception: self.logger.write_error( diff -r 56f08ab3a491 -r 032bf4f225d0 controls/LogViewer.py --- a/controls/LogViewer.py Tue May 30 13:00:50 2023 +0200 +++ b/controls/LogViewer.py Wed May 31 10:38:03 2023 +0200 @@ -39,7 +39,8 @@ THUMB_SIZE_RATIO = 1. / 8. -def ArrowPoints(direction, width, height, xoffset, yoffset): +def ArrowPoints(*args): + direction, width, height, xoffset, yoffset = map(lambda x:x if type(x)==int else int(x), args) if direction == wx.TOP: return [wx.Point(xoffset + 1, yoffset + height - 2), wx.Point(xoffset + width // 2, yoffset + 1), diff -r 56f08ab3a491 -r 032bf4f225d0 util/ProcessLogger.py --- a/util/ProcessLogger.py Tue May 30 13:00:50 2023 +0200 +++ b/util/ProcessLogger.py Wed May 31 10:38:03 2023 +0200 @@ -91,7 +91,7 @@ else: self.Command.append(word) else: - self.Command = Command + self.Command = [x if type(x)==str else x.decode() for x in Command] self.Command_str = subprocess.list2cmdline(self.Command) fsencoding = sys.getfilesystemencoding()