aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@ugent.be>2017-11-21 16:52:40 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-11-21 16:52:40 +0100
commita7003f282570a9526c1abf1e71e57ca8f7f58c24 (patch)
tree5a23250a7f71761a890102ec8ec98f77b6a4f6fb
parentc3e24622a9a7374b6867670517f137a54c7d048f (diff)
downloadrumba-a7003f282570a9526c1abf1e71e57ca8f7f58c24.tar.gz
rumba-a7003f282570a9526c1abf1e71e57ca8f7f58c24.zip
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.
-rw-r--r--rumba/utils.py6
1 files changed, 6 insertions, 0 deletions
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__)