From 31d88f65f0df3d05f8a7c65b743f301b6c6985c2 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 25 Jul 2016 19:05:26 +0300 Subject: [PATCH] Fix raw_input for Py3 compatibility --- m_lib/mcrypt.py | 5 +++++ m_lib/tty_menu.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/m_lib/mcrypt.py b/m_lib/mcrypt.py index 03aa7f6..1335737 100755 --- a/m_lib/mcrypt.py +++ b/m_lib/mcrypt.py @@ -26,6 +26,11 @@ def gen_salt(): def test(): + try: + raw_input + except NameError: # Python 3 + raw_input = input + passwd = raw_input("Enter password: ") salt = gen_salt() encrypted = crypt.crypt(passwd, salt) diff --git a/m_lib/tty_menu.py b/m_lib/tty_menu.py index 897ecc9..06e756e 100755 --- a/m_lib/tty_menu.py +++ b/m_lib/tty_menu.py @@ -6,6 +6,12 @@ from __future__ import print_function import string +try: + raw_input +except NameError: # Python 3 + raw_input = input + + def hmenu(prompt, astring): """ Writes prompt and read result -- 2.39.5