Skip to content

Commit

Permalink
fix Exceptions syntqx for Python 3.6, #103
Browse files Browse the repository at this point in the history
  • Loading branch information
berteh committed Apr 6, 2018
1 parent 709796f commit 145f967
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ScribusGeneratorBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run(self):
logging.info("parsing scribus source file %s"%(self.__dataObject.getScribusSourceFile()))
try:
tree = ET.parse(self.__dataObject.getScribusSourceFile())
except IOError as e:
except IOError as exception:
logging.error("Scribus file not found: %s"%(self.__dataObject.getScribusSourceFile()))
raise
root = tree.getroot()
Expand All @@ -106,7 +106,7 @@ def run(self):
logging.info("parsing data source file %s"%(self.__dataObject.getDataSourceFile()))
try:
csvData = self.getCsvData(self.__dataObject.getDataSourceFile())
except IOError as e:
except IOError as exception:
logging.error("CSV file not found: %s"%(self.__dataObject.getDataSourceFile()))
raise
if(len(csvData) < 1):
Expand Down Expand Up @@ -494,11 +494,11 @@ def getSavedSettings(self):
doc = r.find('DOCUMENT')
storage = doc.find('./JAVA[@NAME="'+CONST.STORAGE_NAME+'"]')
return storage.get("SCRIPT")
except SyntaxError, e:
logging.error("Loading settings in only possible with Python 2.7 and later, please update your system: %s"%e)
except SyntaxError as exception:
logging.error("Loading settings in only possible with Python 2.7 and later, please update your system: %s"%exception)
return None
except Exception, e:
logging.debug("could not load the user settings: %s"%e)
except Exception as exception:
logging.debug("could not load the user settings: %s"%exception)
return None


Expand Down

0 comments on commit 145f967

Please sign in to comment.