fixed PY2 import error on older versions of six

Older versions of six don't have the `PY2` variable. This is causing issues with certain projects that use older versions of six.