From: Oleg Broytman Date: Mon, 25 Jul 2016 16:05:26 +0000 (+0300) Subject: Use int() instead of atoi() for Py3 compatibility X-Git-Tag: 3.0.0b1~1 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=ee5ae8bff7bd4b242788e3ba7807a49a59f79ebb;p=m_lib.git Use int() instead of atoi() for Py3 compatibility --- diff --git a/m_lib/tty_menu.py b/m_lib/tty_menu.py index 06e756e..852de1d 100755 --- a/m_lib/tty_menu.py +++ b/m_lib/tty_menu.py @@ -38,8 +38,8 @@ def vmenu(item_list, prompt, format = "%d. %s"): result = raw_input(prompt) try: - result = string.atoi(result) - except string.atoi_error: + result = int(result) + except ValueError: result = -1 return result