summaryrefslogtreecommitdiffstats
path: root/repo
diff options
context:
space:
mode:
Diffstat (limited to 'repo')
-rwxr-xr-xrepo18
1 files changed, 7 insertions, 11 deletions
diff --git a/repo b/repo
index 768f11f8..f12354a4 100755
--- a/repo
+++ b/repo
@@ -114,6 +114,7 @@ import errno
114import optparse 114import optparse
115import os 115import os
116import re 116import re
117import shutil
117import stat 118import stat
118import subprocess 119import subprocess
119import sys 120import sys
@@ -138,10 +139,6 @@ def _print(*objects, **kwargs):
138 139
139# Python version check 140# Python version check
140ver = sys.version_info 141ver = sys.version_info
141if 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)
145if (ver[0], ver[1]) < MIN_PYTHON_VERSION: 142if (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
774if __name__ == '__main__': 766if __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:])