Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

rosnode: Minor fixes for compatibility with both Python 2 & 3#1166

Merged
dirk-thomas merged 1 commit intoros:lunar-develfrom
kartikmohta:fix/rosnode-py3
Sep 15, 2017
Merged

rosnode: Minor fixes for compatibility with both Python 2 & 3#1166
dirk-thomas merged 1 commit intoros:lunar-develfrom
kartikmohta:fix/rosnode-py3

Conversation

@kartikmohta
Copy link
Copy Markdown
Contributor

No description provided.

@dirk-thomas
Copy link
Copy Markdown
Member

Please provide a reproducible example.

@raise ROSNodeException: if machine name cannot be resolved to an address
@raise ROSNodeIOException: if unable to communicate with master
"""
import urlparse
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Already imported at the top of the file so no need to import here. Moreover there is no urlparse module in Python 3.

try:
# #3659
errnum, msg = e
errnum, msg = e.args
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This way allows it to work for both Python 2 & 3. socket.error is just an alias of OSError in Python 3.

@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for the patch.

Please include a description in future contributions.

@dirk-thomas dirk-thomas merged commit 1e67842 into ros:lunar-devel Sep 15, 2017
@kartikmohta kartikmohta deleted the fix/rosnode-py3 branch September 15, 2017 17:32
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