Converted python2 DictType to python3-compatible isinstance