Skip to content

Commit 37e75f2

Browse files
fmauchdirk-thomas
andauthored
Replace string.atoi with int() (#57)
* Replace string.atoi with int() string-atoi has been deprecated since Python 2.0 (see here: https://docs.python.org/2/library/string.html#string.atoi) It is suggested to use the built-in int() function instead. On Python3-only systems (which will hopefully become more relevant in the near future) this leads to a crash as atoi has been removed completely. * remove obsolete import Co-authored-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
1 parent 0aa24c2 commit 37e75f2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/rqt_plot/rosplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
# POSSIBILITY OF SUCH DAMAGE.
3434
#
3535

36-
import string
3736
import sys
3837
import threading
3938
import time
@@ -198,7 +197,7 @@ def generate_field_evals(fields):
198197
for f in fields:
199198
if '[' in f:
200199
field_name, rest = f.split('[')
201-
slot_num = string.atoi(rest[:rest.find(']')])
200+
slot_num = int(rest[:rest.find(']')])
202201
evals.append(_array_eval(field_name, slot_num))
203202
else:
204203
evals.append(_field_eval(f))

0 commit comments

Comments
 (0)