ContextManager __exit__ fail on TypeError exception

If "type" param is none is raised a exception.