Fixed absent basestring for python3