File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,13 @@ class PyomoException(Exception):
123
123
Exception class for other Pyomo exceptions to inherit from,
124
124
allowing Pyomo exceptions to be caught in a general way
125
125
(e.g., in other applications that use Pyomo).
126
- Subclasses should define a class-level `default_message` attribute.
126
+ Subclasses can define a class-level `default_message` attribute.
127
127
"""
128
128
129
- default_message = None
130
-
131
- def __init__ (self , message = None ):
132
- super ().__init__ (message or self . default_message )
129
+ def __init__ ( self , * args ):
130
+ if not args and getattr ( self , 'default_message' , None ):
131
+ args = (self . default_message ,)
132
+ return super ().__init__ (* args )
133
133
134
134
135
135
class DeferredImportError (ImportError ):
You can’t perform that action at this time.
0 commit comments