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 rosservice call for python3. #847

Merged
merged 1 commit into from
Jul 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tools/rosservice/src/rosservice/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
import socket

try:
from cStringIO import StringIO # Python 2.x
from cStringIO import StringIO as BufferType # Python 2.x
except ImportError:
from io import StringIO # Python 3.x
from io import BytesIO as BufferType # Python 3.x

import genpy

Expand Down Expand Up @@ -121,7 +121,7 @@ def get_service_headers(service_name, service_uri):
header = { 'probe':'1', 'md5sum':'*',
'callerid':'/rosservice', 'service':service_name}
rosgraph.network.write_ros_handshake_header(s, header)
return rosgraph.network.read_ros_handshake_header(s, StringIO(), 2048)
return rosgraph.network.read_ros_handshake_header(s, BufferType(), 2048)
except socket.error:
raise ROSServiceIOException("Unable to communicate with service [%s], address [%s]"%(service_name, service_uri))
finally:
Expand Down