summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/main.py b/main.py
index 9cc2639a..e4cdeb0f 100755
--- a/main.py
+++ b/main.py
@@ -22,13 +22,12 @@ import optparse
22import os 22import os
23import sys 23import sys
24import time 24import time
25try: 25
26 import urllib2 26from pyversion import is_python3
27except ImportError: 27if is_python3():
28 # For python3
29 import urllib.request 28 import urllib.request
30else: 29else:
31 # For python2 30 import urllib2
32 urllib = imp.new_module('urllib') 31 urllib = imp.new_module('urllib')
33 urllib.request = urllib2 32 urllib.request = urllib2
34 33
@@ -50,6 +49,11 @@ from pager import RunPager
50 49
51from subcmds import all_commands 50from subcmds import all_commands
52 51
52if not is_python3():
53 # pylint:disable=W0622
54 input = raw_input
55 # pylint:enable=W0622
56
53global_options = optparse.OptionParser( 57global_options = optparse.OptionParser(
54 usage="repo [-p|--paginate|--no-pager] COMMAND [ARGS]" 58 usage="repo [-p|--paginate|--no-pager] COMMAND [ARGS]"
55 ) 59 )
@@ -286,7 +290,7 @@ def _AddPasswordFromUserInput(handler, msg, req):
286 if user is None: 290 if user is None:
287 print(msg) 291 print(msg)
288 try: 292 try:
289 user = raw_input('User: ') 293 user = input('User: ')
290 password = getpass.getpass() 294 password = getpass.getpass()
291 except KeyboardInterrupt: 295 except KeyboardInterrupt:
292 return 296 return