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

Side by Side Diff: presubmit_support.py

Issue 1520025: Fix presubmit_unittests on some versions of python2.5.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 10 years, 8 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 | Annotate | Revision Log
« 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/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 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 """Enables directory-specific presubmit checks to run at upload and/or commit. 6 """Enables directory-specific presubmit checks to run at upload and/or commit.
7 """ 7 """
8 8
9 __version__ = '1.3.4' 9 __version__ = '1.3.4'
10 10
(...skipping 21 matching lines...) Expand all
32 import types 32 import types
33 import unittest # Exposed through the API. 33 import unittest # Exposed through the API.
34 import urllib2 # Exposed through the API. 34 import urllib2 # Exposed through the API.
35 import warnings 35 import warnings
36 36
37 try: 37 try:
38 import simplejson as json 38 import simplejson as json
39 except ImportError: 39 except ImportError:
40 try: 40 try:
41 import json 41 import json
42 except ImportError: 42 # Some versions of python2.5 have an incomplete json module. Check to make
43 # sure loads exists.
44 json.loads
M-A Ruel 2010/04/08 01:31:58 That doesn't throw on 2.6? In any case, even if i
45 except (ImportError, AttributeError):
43 # Import the one included in depot_tools. 46 # Import the one included in depot_tools.
44 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) 47 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party'))
45 import simplejson as json 48 import simplejson as json
46 49
47 # Local imports. 50 # Local imports.
48 import gcl 51 import gcl
49 import gclient_utils 52 import gclient_utils
50 import presubmit_canned_checks 53 import presubmit_canned_checks
51 import scm 54 import scm
52 55
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 options.commit, 1063 options.commit,
1061 options.verbose, 1064 options.verbose,
1062 sys.stdout, 1065 sys.stdout,
1063 sys.stdin, 1066 sys.stdin,
1064 options.default_presubmit, 1067 options.default_presubmit,
1065 options.may_prompt) 1068 options.may_prompt)
1066 1069
1067 1070
1068 if __name__ == '__main__': 1071 if __name__ == '__main__':
1069 sys.exit(Main(sys.argv)) 1072 sys.exit(Main(sys.argv))
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