Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: gclient.py

Issue 12035089: handle bad python install (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: untabify Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Meta checkout manager supporting both Subversion and GIT. 6 """Meta checkout manager supporting both Subversion and GIT.
7 7
8 Files 8 Files
9 .gclient : Current client configuration, written by 'config' command. 9 .gclient : Current client configuration, written by 'config' command.
10 Format is a Python script defining 'solutions', a list whose 10 Format is a Python script defining 'solutions', a list whose
(...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1712 1712
1713 1713
1714 def Main(argv): 1714 def Main(argv):
1715 """Doesn't parse the arguments here, just find the right subcommand to 1715 """Doesn't parse the arguments here, just find the right subcommand to
1716 execute.""" 1716 execute."""
1717 if sys.hexversion < 0x02060000: 1717 if sys.hexversion < 0x02060000:
1718 print >> sys.stderr, ( 1718 print >> sys.stderr, (
1719 '\nYour python version %s is unsupported, please upgrade.\n' % 1719 '\nYour python version %s is unsupported, please upgrade.\n' %
1720 sys.version.split(' ', 1)[0]) 1720 sys.version.split(' ', 1)[0])
1721 return 2 1721 return 2
1722 if not sys.executable:
1723 print >> sys.stderr, (
1724 '\nPython cannot find the location of it\'s own executable.\n')
1725 return 2
1722 colorama.init() 1726 colorama.init()
1723 try: 1727 try:
1724 # Make stdout auto-flush so buildbot doesn't kill us during lengthy 1728 # Make stdout auto-flush so buildbot doesn't kill us during lengthy
1725 # operations. Python as a strong tendency to buffer sys.stdout. 1729 # operations. Python as a strong tendency to buffer sys.stdout.
1726 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout) 1730 sys.stdout = gclient_utils.MakeFileAutoFlush(sys.stdout)
1727 # Make stdout annotated with the thread ids. 1731 # Make stdout annotated with the thread ids.
1728 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout) 1732 sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout)
1729 # Do it late so all commands are listed. 1733 # Do it late so all commands are listed.
1730 # Unused variable 'usage' 1734 # Unused variable 'usage'
1731 # pylint: disable=W0612 1735 # pylint: disable=W0612
(...skipping 18 matching lines...) Expand all
1750 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1754 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1751 print >> sys.stderr, 'Error: %s' % str(e) 1755 print >> sys.stderr, 'Error: %s' % str(e)
1752 return 1 1756 return 1
1753 1757
1754 1758
1755 if '__main__' == __name__: 1759 if '__main__' == __name__:
1756 fix_encoding.fix_encoding() 1760 fix_encoding.fix_encoding()
1757 sys.exit(Main(sys.argv[1:])) 1761 sys.exit(Main(sys.argv[1:]))
1758 1762
1759 # vim: ts=2:sw=2:tw=80:et: 1763 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698