diff options
Diffstat (limited to 'repo')
-rwxr-xr-x | repo | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -114,6 +114,7 @@ import errno | |||
114 | import optparse | 114 | import optparse |
115 | import os | 115 | import os |
116 | import re | 116 | import re |
117 | import shutil | ||
117 | import stat | 118 | import stat |
118 | import subprocess | 119 | import subprocess |
119 | import sys | 120 | import sys |
@@ -138,10 +139,6 @@ def _print(*objects, **kwargs): | |||
138 | 139 | ||
139 | # Python version check | 140 | # Python version check |
140 | ver = sys.version_info | 141 | ver = sys.version_info |
141 | if ver[0] == 3: | ||
142 | _print('warning: Python 3 support is currently experimental. YMMV.\n' | ||
143 | 'Please use Python 2.6 - 2.7 instead.', | ||
144 | file=sys.stderr) | ||
145 | if (ver[0], ver[1]) < MIN_PYTHON_VERSION: | 142 | if (ver[0], ver[1]) < MIN_PYTHON_VERSION: |
146 | _print('error: Python version %s unsupported.\n' | 143 | _print('error: Python version %s unsupported.\n' |
147 | 'Please use Python 2.6 - 2.7 instead.' | 144 | 'Please use Python 2.6 - 2.7 instead.' |
@@ -465,7 +462,7 @@ def _DownloadBundle(url, local, quiet): | |||
465 | try: | 462 | try: |
466 | r = urllib.request.urlopen(url) | 463 | r = urllib.request.urlopen(url) |
467 | except urllib.error.HTTPError as e: | 464 | except urllib.error.HTTPError as e: |
468 | if e.code in [403, 404]: | 465 | if e.code in [401, 403, 404]: |
469 | return False | 466 | return False |
470 | _print('fatal: Cannot get %s' % url, file=sys.stderr) | 467 | _print('fatal: Cannot get %s' % url, file=sys.stderr) |
471 | _print('fatal: HTTP error %s' % e.code, file=sys.stderr) | 468 | _print('fatal: HTTP error %s' % e.code, file=sys.stderr) |
@@ -741,12 +738,7 @@ def main(orig_args): | |||
741 | try: | 738 | try: |
742 | _Init(args) | 739 | _Init(args) |
743 | except CloneFailure: | 740 | except CloneFailure: |
744 | for root, dirs, files in os.walk(repodir, topdown=False): | 741 | shutil.rmtree(os.path.join(repodir, S_repo), ignore_errors=True) |
745 | for name in files: | ||
746 | os.remove(os.path.join(root, name)) | ||
747 | for name in dirs: | ||
748 | os.rmdir(os.path.join(root, name)) | ||
749 | os.rmdir(repodir) | ||
750 | sys.exit(1) | 742 | sys.exit(1) |
751 | repo_main, rel_repo_dir = _FindRepo() | 743 | repo_main, rel_repo_dir = _FindRepo() |
752 | else: | 744 | else: |
@@ -772,4 +764,8 @@ def main(orig_args): | |||
772 | 764 | ||
773 | 765 | ||
774 | if __name__ == '__main__': | 766 | if __name__ == '__main__': |
767 | if ver[0] == 3: | ||
768 | _print('warning: Python 3 support is currently experimental. YMMV.\n' | ||
769 | 'Please use Python 2.6 - 2.7 instead.', | ||
770 | file=sys.stderr) | ||
775 | main(sys.argv[1:]) | 771 | main(sys.argv[1:]) |