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

Add Python3 compatibility #300

Merged
merged 6 commits into from
Nov 6, 2017
Merged

Add Python3 compatibility #300

merged 6 commits into from
Nov 6, 2017

Conversation

kartikmohta
Copy link
Contributor

All the unit tests seem to pass with both Python 2 and 3.

Copy link
Member

@jihoonl jihoonl left a comment

Choose a reason for hiding this comment

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

thanks for PR @kartikmohta, please check a comment in the code.

if sys.version_info >= (3, 0):
string_types = str
else:
string_types = (str, unicode)
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this into rosbridge_library/utils/__init__.py and import from there? Then, we can avoid copy and pasting of the same functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that seems better 👍

@jihoonl jihoonl merged commit 4b98dc7 into RobotWebTools:develop Nov 6, 2017
@kartikmohta kartikmohta deleted the fix/python3-compatibility branch December 8, 2017 16:49
Behery pushed a commit to Behery/rosbridge_suite that referenced this pull request Jan 9, 2018
* First pass at Python 3 compatibility
* message_conversion: Only call encode on a Python2 str or bytes type
* protocol.py: Changes for dict in Python3. Compatible with Python 2 too.
* More Python 3 fixes, all tests pass
* Move definition of string_types to rosbridge_library.util
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.

None yet

2 participants