diff options
Diffstat (limited to 'main.py')
| -rwxr-xr-x | main.py | 22 |
1 files changed, 11 insertions, 11 deletions
| @@ -274,17 +274,17 @@ class _UserAgentHandler(urllib.request.BaseHandler): | |||
| 274 | return req | 274 | return req |
| 275 | 275 | ||
| 276 | def _AddPasswordFromUserInput(handler, msg, req): | 276 | def _AddPasswordFromUserInput(handler, msg, req): |
| 277 | # If repo could not find auth info from netrc, try to get it from user input | 277 | # If repo could not find auth info from netrc, try to get it from user input |
| 278 | url = req.get_full_url() | 278 | url = req.get_full_url() |
| 279 | user, password = handler.passwd.find_user_password(None, url) | 279 | user, password = handler.passwd.find_user_password(None, url) |
| 280 | if user is None: | 280 | if user is None: |
| 281 | print(msg) | 281 | print(msg) |
| 282 | try: | 282 | try: |
| 283 | user = raw_input('User: ') | 283 | user = raw_input('User: ') |
| 284 | password = getpass.getpass() | 284 | password = getpass.getpass() |
| 285 | except KeyboardInterrupt: | 285 | except KeyboardInterrupt: |
| 286 | return | 286 | return |
| 287 | handler.passwd.add_password(None, url, user, password) | 287 | handler.passwd.add_password(None, url, user, password) |
| 288 | 288 | ||
| 289 | class _BasicAuthHandler(urllib.request.HTTPBasicAuthHandler): | 289 | class _BasicAuthHandler(urllib.request.HTTPBasicAuthHandler): |
| 290 | def http_error_401(self, req, fp, code, msg, headers): | 290 | def http_error_401(self, req, fp, code, msg, headers): |
