Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for TypeError: can only concatenate str (not "type") to str #288

Merged
merged 2 commits into from
Jul 14, 2022

Conversation

Markus28
Copy link
Contributor

An unexpected exception is encountered in the code below

>>> import mip
>>> m = mip.Model()
>>> m.remove(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/markus/OpenSourceDev/python-mip/mip/model.py", line 1429, in remove
    "Cannot handle removal of object of type "
TypeError: can only concatenate str (not "type") to str

We would want it to throw TypeError: Cannot handle removal of object of type <class 'NoneType'> from model but while the error message is assembled, a different exception is encountered because you are trying to concatenate a string to a type.

Not a big issue but it's a quick fix :)

@CLAassistant
Copy link

CLAassistant commented Jul 11, 2022

CLA assistant check
All committers have signed the CLA.

mip/model.py Show resolved Hide resolved
@sebheger sebheger merged commit 8a6ac41 into coin-or:master Jul 14, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants