From a7003f282570a9526c1abf1e71e57ca8f7f58c24 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 21 Nov 2017 16:52:40 +0100 Subject: utils: Add check for Python 2 This adds a check in case Python 2 is used, since it doesn't have input(). It assigns raw_input to input if this is the case. --- rumba/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'rumba/utils.py') diff --git a/rumba/utils.py b/rumba/utils.py index 0e8867d..7417074 100644 --- a/rumba/utils.py +++ b/rumba/utils.py @@ -29,6 +29,12 @@ import time import rumba.log as log import rumba.model as model +# Fix Python 2.x. +try: + input = raw_input +except NameError: + pass + logger = log.get_logger(__name__) -- cgit v1.2.3