Fix(MO): MOMonomial variable can be str in __init__

This commit is contained in:
Bertrand Benjamin 2018-11-13 15:55:55 +01:00
parent 17153dd345
commit f6f6741398
1 changed files with 5 additions and 4 deletions

View File

@ -101,10 +101,11 @@ class MOMonomial(MO):
raise MOError("The coefficient of a monomial should not be 0")
self._coefficient = _coefficient
if isinstance(variable, MOstrPower):
_variable = variable.variable
_power = MO.factory(variable.power.value * power)
elif isinstance(variable, MOstr):
_variable = MO.factory(variable)
if isinstance(_variable, MOstrPower):
_power = MO.factory(_variable.power.value * power)
_variable = _variable.variable
elif isinstance(_variable, MOstr):
_variable = variable
_power = MO.factory(power)
else: