flake8 fixes
No basestring in Python 3