Updated to work around StrAndUnicode removal in 1.7 (fixes #61)

Let's make this a `hasattr` check