Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Fix import errors due to conditional absolute imports #155
Conversation
There were import errors due to redefinition of the top-level `mip`
module through conditional absolute imports when explicitly specifying
the solver:
>>> import mip
>>> mip.Model()
<mip.model.Model object at 0x10f576700>
>>> mip.Model(solver=mip.CBC)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../mip/model.py", line 104, in __init__
self.constrs = mip.ConstrList(self)
UnboundLocalError: local variable 'mip' referenced before assignment
>>> mip.Model(solver=mip.GUROBI)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../mip/model.py", line 104, in __init__
self.constrs = mip.ConstrList(self)
UnboundLocalError: local variable 'mip' referenced before assignment
This patch fixes these imprt errors through selective use of relative imports.
There were import errors due to redefinition of the top-level
mipmodule through conditional absolute imports when explicitly specifying the solver:This patch fixes these imprt errors through selective use of relative imports.