Skip to content

Use of six.text type in isinstance #64

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

Closed
wants to merge 6 commits into from
Closed

Conversation

marcdm
Copy link

@marcdm marcdm commented Jun 16, 2013

As reported in #63, there are a couple places where isinstance(varname, six.text_type) is called. This is ok on Python 3, but not on Python 2.

This patch fixes the issue. I don't quite understand the format of the included test architecture, so I created a standalone test; included.

All 26941 tests pass on Python 2.7.5+ and 3.2.4 on Debian Jessie.

@hoppipolla-critic-bot
Copy link

Critic review: https://critic.hoppipolla.co.uk/r/179

This is an external review system which you may optionally use for the code review of your pull request.

@gsnedders
Copy link
Member

There are review comments on Critic (I don't think you get notification emails till you first visit).

@marcdm
Copy link
Author

marcdm commented Jun 19, 2013

The intention with the test is to simulate a naive user using Python 2.x and casually adding an attribute without specifying strings as u'att_name' or importing unicode_literals.

The tests run by test_treewalker_six_mix will pass on Python 3.x but fail on Python 2.x and the pull-request contains a fix and some suggestions for minor code refactoring ( e.g. to_text and is_text_or_none )

@gsnedders
Copy link
Member

Merged in 1d3434f.

@gsnedders gsnedders closed this Jun 26, 2013
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.

3 participants