ManderaGeneral/generalimport

Unhandled - `raise X`, same as `isinstance(X, int)`

Mandera opened this issue · 2 comments

from generalimport import generalimport
generalimport("foobar")

import foobar.error as er
raise er

TypeError: exceptions must derive from BaseException

Seems hard to fix, could make FakeModule inherit BaseException but then it wants a proper dunder str and I don't think that's worth it since dunder str probably has a decent portion of the triggers.

This type of issue should be listed and generalized, there will be more cases we cannot cover

Might be able to use __instancecheck__ if we make normal check fail: https://stackoverflow.com/questions/47740953/why-isnt-instancecheck-being-called