diff options
Diffstat (limited to 'subcmds')
| -rw-r--r-- | subcmds/sync.py | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 0fc493c4..6191a3c3 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -65,7 +65,7 @@ except ImportError: | |||
| 65 | multiprocessing = None | 65 | multiprocessing = None |
| 66 | 66 | ||
| 67 | from git_command import GIT, git_require | 67 | from git_command import GIT, git_require |
| 68 | from git_config import GetSchemeFromUrl, GetUrlCookieFile | 68 | from git_config import GetUrlCookieFile |
| 69 | from git_refs import R_HEADS, HEAD | 69 | from git_refs import R_HEADS, HEAD |
| 70 | import gitc_utils | 70 | import gitc_utils |
| 71 | from project import Project | 71 | from project import Project |
| @@ -586,19 +586,18 @@ later is required to fix a server side protocol bug. | |||
| 586 | try: | 586 | try: |
| 587 | info = netrc.netrc() | 587 | info = netrc.netrc() |
| 588 | except IOError: | 588 | except IOError: |
| 589 | print('.netrc file does not exist or could not be opened', | 589 | # .netrc file does not exist or could not be opened |
| 590 | file=sys.stderr) | 590 | pass |
| 591 | else: | 591 | else: |
| 592 | try: | 592 | try: |
| 593 | parse_result = urllib.parse.urlparse(manifest_server) | 593 | parse_result = urllib.parse.urlparse(manifest_server) |
| 594 | if parse_result.hostname: | 594 | if parse_result.hostname: |
| 595 | username, _account, password = \ | 595 | auth = info.authenticators(parse_result.hostname) |
| 596 | info.authenticators(parse_result.hostname) | 596 | if auth: |
| 597 | except TypeError: | 597 | username, _account, password = auth |
| 598 | # TypeError is raised when the given hostname is not present | 598 | else: |
| 599 | # in the .netrc file. | 599 | print('No credentials found for %s in .netrc' |
| 600 | print('No credentials found for %s in .netrc' | 600 | % parse_result.hostname, file=sys.stderr) |
| 601 | % parse_result.hostname, file=sys.stderr) | ||
| 602 | except netrc.NetrcParseError as e: | 601 | except netrc.NetrcParseError as e: |
| 603 | print('Error parsing .netrc file: %s' % e, file=sys.stderr) | 602 | print('Error parsing .netrc file: %s' % e, file=sys.stderr) |
| 604 | 603 | ||
