Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 fix #33

Closed
wants to merge 1 commit into from
Closed

python3 fix #33

wants to merge 1 commit into from

Conversation

askovpen
Copy link

in python3.4:

NameError: name 'basestring' is not defined

@dvander
Copy link
Member

dvander commented Nov 29, 2015

This is not quite right, since on Python 2.7:

>>> isinstance('', str)
True
>>> isinstance(u'', str)
False

Probably the right thing to do is check isinstance(blah, basestring) on Python 2 (I usually check if str == bytes for that), and isinstance(blah, str) on Python 3.

@powerlord
Copy link

@dvander So, are you saying IsString should be rolled back to its old version?

@dvander
Copy link
Member

dvander commented Jan 19, 2016

Not quite, the old version doesn't use isinstance.

@WildCard65
Copy link
Contributor

@dvander Would doing a check of sys.version_info work?

WildCard65 added a commit to WildCard65/ambuild that referenced this pull request Feb 11, 2016
@asherkin asherkin closed this Feb 23, 2016
WildCard65 added a commit to WildCard65/ambuild that referenced this pull request Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants