You can try:
>>> variable = None
>>> isinstance(variable,type(None))
True
>>> variable = True
>>> isinstance(variable,type(None))
False
isinstance takes 2 arguments isinstance(object, classinfo)
Here, by passing None
you are setting classinfo
to None, hence the error. You need pass in the type.