Well, this is sort of a bad way to do this.  This try-except block should be something like 

```python
import sys
if sys.version_info[0] > 2"
    basestring = str
```