python 3 comaptibility fix: defined basestring