Skip to content
This repository was archived by the owner on Aug 29, 2019. It is now read-only.

Conversation

@jmichelsen
Copy link

No description provided.

@jmichelsen
Copy link
Author

I know pr #32 exists to convert the repo to python3 using the 2to3 utility. I converted this manually to allow it to remain backwards compatible with python2.6 and python2.7. Cheers.

'{0}: {1}'.format(error_type, error_msg))

if response == 'body' and isinstance(content, str):
if isinstance(content, six.binary_type):
Copy link

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good aside from needing to pull in six as a requirement. Can you check this without it?

An example from http://python3porting.com/noconv.html#more-bytes-strings-and-unicode:

>>> from __future__ import unicode_literals
>>> import sys
>>> if sys.version_info < (3,):
...     text_type = unicode
...     binary_type = str
... else:
...     text_type = str
...     binary_type = bytes
>>> isinstance('U\xf1ic\xf6de', text_type)
True

Copy link
Author

Choose a reason for hiding this comment

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

Sure. I'll update this

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants