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

Fix tests on Python 3. #22

Merged
merged 1 commit into from
Sep 19, 2017
Merged

Fix tests on Python 3. #22

merged 1 commit into from
Sep 19, 2017

Conversation

jamadden
Copy link
Member

@jamadden jamadden commented Sep 18, 2017

  • Syntax fixes. Sometimes we were doing an unneeded raise t, v, tb, so stop doing that. Where we do need that, use six.reraise.
    Also delete the temporary variables to avoid reference cycles.
  • Require a newer six for the same reason as above.
  • d.iteritems -> six.iteritems(d)
  • plistlib API changed
  • A few places we were assuming unicode or basestring. One of them needs to be tightened on Python 2, left an XXX comment about that.

Fixes #17

- Syntax fixes. Sometimes we were doing an unneeded `raise t, v, tb`,
  so stop doing that. Where we do need that, use `six.reraise`.
  Also delete the temporary variables to avoid reference cycles.
- Require a newer six for the same reason as above.
- d.iteritems -> six.iteritems(d)
- plistlib API changed
@jamadden jamadden requested review from papachoco and removed request for papachoco September 18, 2017 18:06
Copy link
Contributor

@papachoco papachoco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jamadden jamadden merged commit d60691f into master Sep 19, 2017
@jamadden jamadden deleted the issue17 branch September 19, 2017 17:08
@jamadden
Copy link
Member Author

Thanks.

@papachoco
Copy link
Contributor

papachoco commented Sep 19, 2017

Curious question.. any reason to have

logger = __import__('logging').getLogger(__name__)

after declaring all imports?

Carlos

@jamadden
Copy link
Member Author

Yes, it's a PEP8 style guideline: imports go first, before any variable declarations. pylint produces a wrong-import-position warning when that's not the case.
screen shot 2017-09-19 at 12 21 35

@papachoco
Copy link
Contributor

Thx

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.

Fix Python 3 support
2 participants