Skip to content

Commit e0a1ac0

Browse files
committed
[OMCSessionBase] fix usage of excaptions - replace ex.message() by ex.msg()
1 parent 4516a45 commit e0a1ac0

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

OMPython/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def getClassComment(self, className):
219219
return self.ask('getClassComment', className)
220220
except pyparsing.ParseException as ex:
221221
logger.warning("Method 'getClassComment' failed for {0}".format(className))
222-
logger.warning('OMTypedParser error: {0}'.format(ex.message))
222+
logger.warning('OMTypedParser error: {0}'.format(ex.msg))
223223
return 'No description available'
224224

225225
def getNthComponent(self, className, comp_id):
@@ -254,7 +254,7 @@ def getParameterValue(self, className, parameterName):
254254
try:
255255
return self.ask('getParameterValue', '{0}, {1}'.format(className, parameterName))
256256
except pyparsing.ParseException as ex:
257-
logger.warning('OMTypedParser error: {0}'.format(ex.message))
257+
logger.warning('OMTypedParser error: {0}'.format(ex.msg))
258258
return ""
259259

260260
def getComponentModifierNames(self, className, componentName):
@@ -265,7 +265,7 @@ def getComponentModifierValue(self, className, componentName):
265265
# FIXME: OMPython exception UnboundLocalError exception for 'Modelica.Fluid.Machines.ControlledPump'
266266
return self.ask('getComponentModifierValue', '{0}, {1}'.format(className, componentName))
267267
except pyparsing.ParseException as ex:
268-
logger.warning('OMTypedParser error: {0}'.format(ex.message))
268+
logger.warning('OMTypedParser error: {0}'.format(ex.msg))
269269
result = self.ask('getComponentModifierValue', '{0}, {1}'.format(className, componentName), parsed=False)
270270
try:
271271
answer = OMParser.check_for_values(result)
@@ -283,7 +283,7 @@ def getExtendsModifierValue(self, className, extendsName, modifierName):
283283
# FIXME: OMPython exception UnboundLocalError exception for 'Modelica.Fluid.Machines.ControlledPump'
284284
return self.ask('getExtendsModifierValue', '{0}, {1}, {2}'.format(className, extendsName, modifierName))
285285
except pyparsing.ParseException as ex:
286-
logger.warning('OMTypedParser error: {0}'.format(ex.message))
286+
logger.warning('OMTypedParser error: {0}'.format(ex.msg))
287287
result = self.ask('getExtendsModifierValue', '{0}, {1}, {2}'.format(className, extendsName, modifierName), parsed=False)
288288
try:
289289
answer = OMParser.check_for_values(result)
@@ -1401,7 +1401,7 @@ def checkValidInputs(self, name):
14011401
if l[0] < float(self.simulateOptions["startTime"]):
14021402
ModelicaSystemError('Input time value is less than simulation startTime')
14031403
if len(l) != 2:
1404-
ModelicaSystemError('Value for ' + l + ' is in incorrect format!')
1404+
ModelicaSystemError('Value for ' + str(l) + ' is in incorrect format!')
14051405
else:
14061406
ModelicaSystemError('Error!!! Value must be in tuple format')
14071407

0 commit comments

Comments
 (0)