From a04ef2de431115486e6e32bb5380c1799f081ad1 Mon Sep 17 00:00:00 2001 From: Murtuza Zabuawala Date: Fri, 4 Dec 2015 15:37:04 +0530 Subject: [PATCH] Fixed an issue related taking input as raw_input on Python 2. This is regression, introduced in the commit-id: 209ee78b252fb063e34681acc658b479585d2aba --- web/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/setup.py b/web/setup.py index 9f430ae14..7c46cd603 100644 --- a/web/setup.py +++ b/web/setup.py @@ -26,6 +26,10 @@ from pgadmin.settings.settings_model import db, Role, User, Server, \ # Configuration settings import config +# If script is running under python2 then change the behaviour of functions +if hasattr(__builtins__, 'raw_input'): + input = raw_input + range = xrange def do_setup(app): @@ -35,7 +39,7 @@ def do_setup(app): email = config.DESKTOP_USER p1 = ''.join([ random.choice(string.ascii_letters + string.digits) - for n in xrange(32) + for n in range(32) ]) else: