From 2dc65cdb286c96286228a412c5f9dd6ff32ff4ac Mon Sep 17 00:00:00 2001 From: Serge Rehbinder Date: Wed, 17 Feb 2016 15:07:06 +0100 Subject: [PATCH] fix python3 compatibility for open() --- salomeTools.py | 4 ++-- src/logger.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/salomeTools.py b/salomeTools.py index 33288fb..bc5f8aa 100755 --- a/salomeTools.py +++ b/salomeTools.py @@ -92,7 +92,7 @@ class Sat(object): self.options = options # the options passed to salomeTools self.dataDir = dataDir # default value will be /data # set the commands by calling the dedicated function - self.__setCommands__(cmdsdir) + self._setCommands(cmdsdir) # if the help option has been called, print help and exit if options.help: @@ -113,7 +113,7 @@ class Sat(object): else: raise AttributeError(name + _(" is not a valid command")) - def __setCommands__(self, dirPath): + def _setCommands(self, dirPath): '''set class attributes corresponding to all commands that are in the dirPath directory :param dirPath str: The directory path containing the commands diff --git a/src/logger.py b/src/logger.py index e2fcc0d..19a53ac 100644 --- a/src/logger.py +++ b/src/logger.py @@ -58,7 +58,7 @@ class Logger(object): self.xmlFile = xmlManager.xmlLogFile(logFilePath, "SATcommand", attrib = {"application" : config.VARS.application}) self.putInitialXMLFields() # Initialize the txt file for reading - self.logTxtFile = open(str(self.txtFilePath), 'w', buffering=0) + self.logTxtFile = open(str(self.txtFilePath), 'w') def putInitialXMLFields(self): '''Method called at class initialization : Put all fields corresponding to the command context (user, time, ...) -- 2.39.2