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 rostopic hz and bw in Python 3 #1126

Merged
merged 7 commits into from
Aug 15, 2017
12 changes: 2 additions & 10 deletions tools/rostopic/src/rostopic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1488,11 +1488,7 @@ def _rostopic_cmd_hz(argv):
if len(args) == 0:
parser.error("topic must be specified")
try:
if options.window_size != -1:
import string
window_size = string.atoi(options.window_size)
else:
window_size = options.window_size
window_size = int(options.window_size)
except:
parser.error("window size must be an integer")

Expand Down Expand Up @@ -1540,11 +1536,7 @@ def _rostopic_cmd_bw(argv=sys.argv):
if len(args) > 1:
parser.error("you may only specify one input topic")
try:
if options.window_size:
import string
window_size = string.atoi(options.window_size)
else:
window_size = options.window_size
window_size = int(options.window_size) if options.window_size is not None else None
except:
parser.error("window size must be an integer")
topic = rosgraph.names.script_resolve_name('rostopic', args[0])
Expand Down