Skip to content

Request: Python3 support: replace basestring #1

Description

@jacobq

It looks like you're using basestring, which only works in Python2. I'm not sure what else may need to be modified, but it would be nice if I could run this in Python3.

A relatively simple fix for this particular compatibility issue is described in this issue, and you can also see what the six source code does to address this.

Something like:

# basestring is not available in Python3, use str instead
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3

if PY3:
    string_types = str
else:
    string_types = basestring

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions