Use basestring to allow comparisons to unicode in Python 2