diff --git a/checkout.py b/checkout.py index 15a10160d..68b908ca5 100644 --- a/checkout.py +++ b/checkout.py @@ -7,7 +7,6 @@ Includes support for svn, git-svn and git. """ -from __future__ import with_statement import ConfigParser import fnmatch import logging diff --git a/gcl.py b/gcl.py index d846156b0..bc37b7e07 100755 --- a/gcl.py +++ b/gcl.py @@ -8,6 +8,7 @@ Wrapper script around Rietveld's upload.py that simplifies working with groups of files. """ +import json import optparse import os import random @@ -20,15 +21,6 @@ import urllib2 import breakpad # pylint: disable=W0611 -try: - import simplejson as json # pylint: disable=F0401 -except ImportError: - try: - import json # pylint: disable=F0401 - except ImportError: - # Import the one included in depot_tools. - sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) - import simplejson as json # pylint: disable=F0401 import fix_encoding import gclient_utils diff --git a/git_cl.py b/git_cl.py index cf113b89b..a111eac24 100755 --- a/git_cl.py +++ b/git_cl.py @@ -7,6 +7,7 @@ """A git-command for integrating reviews on Rietveld.""" +import json import logging import optparse import os @@ -23,16 +24,6 @@ try: except ImportError: pass -try: - import simplejson as json # pylint: disable=F0401 -except ImportError: - try: - import json # pylint: disable=F0401 - except ImportError: - # Fall back to the packaged version. - sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) - import simplejson as json # pylint: disable=F0401 - from third_party import upload import breakpad # pylint: disable=W0611 diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index c41cbba42..be84cd726 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -695,9 +695,6 @@ def CheckRietveldTryJobExecution(input_api, output_api, host_url, platforms, def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings, ignored): - if not input_api.json: - return [output_api.PresubmitPromptWarning( - 'Please install simplejson or upgrade to python 2.6+')] try: connection = input_api.urllib2.urlopen(url) raw_data = connection.read() diff --git a/presubmit_support.py b/presubmit_support.py index 0b72f4656..75977553d 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -17,6 +17,7 @@ import cStringIO # Exposed through the API. import fnmatch import glob import inspect +import json # Exposed through the API. import logging import marshal # Exposed through the API. import optparse @@ -33,16 +34,6 @@ import unittest # Exposed through the API. import urllib2 # Exposed through the API. from warnings import warn -try: - import simplejson as json # pylint: disable=F0401 -except ImportError: - try: - import json # pylint: disable=F0401 - except ImportError: - # Import the one included in depot_tools. - sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) - import simplejson as json # pylint: disable=F0401 - # Local imports. import fix_encoding import gclient_utils diff --git a/rietveld.py b/rietveld.py index aafa24e7c..6fc579632 100644 --- a/rietveld.py +++ b/rietveld.py @@ -13,23 +13,12 @@ The following hypothesis are made: - A patch set cannot be modified """ +import json import logging -import os import re -import sys import time import urllib2 -try: - import simplejson as json # pylint: disable=F0401 -except ImportError: - try: - import json # pylint: disable=F0401 - except ImportError: - # Import the one included in depot_tools. - sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) - import simplejson as json # pylint: disable=F0401 - from third_party import upload import patch diff --git a/subprocess2.py b/subprocess2.py index ef95d6f87..043194f47 100644 --- a/subprocess2.py +++ b/subprocess2.py @@ -1,5 +1,5 @@ # coding=utf8 -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Collection of subprocess wrapper functions. @@ -7,7 +7,6 @@ In theory you shouldn't need anything else in subprocess, or this module failed. """ -from __future__ import with_statement import cStringIO import errno import logging diff --git a/tests/checkout_test.py b/tests/checkout_test.py index 939c0b7c4..8128e0269 100755 --- a/tests/checkout_test.py +++ b/tests/checkout_test.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for checkout.py.""" -from __future__ import with_statement import logging import os import shutil diff --git a/tests/gclient_test.py b/tests/gclient_test.py index c76f6d32d..a1433e38b 100755 --- a/tests/gclient_test.py +++ b/tests/gclient_test.py @@ -8,7 +8,6 @@ See gclient_smoketest.py for integration tests. """ -from __future__ import with_statement import Queue import logging import os diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py index a69b7cd8d..ca17cd39a 100755 --- a/tests/scm_unittest.py +++ b/tests/scm_unittest.py @@ -1,11 +1,10 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for scm.py.""" -from __future__ import with_statement import logging import os import sys diff --git a/trychange.py b/trychange.py index e37347c67..4a29aecd6 100755 --- a/trychange.py +++ b/trychange.py @@ -11,6 +11,7 @@ to the server by HTTP. import datetime import errno import getpass +import json import logging import optparse import os @@ -21,16 +22,6 @@ import sys import tempfile import urllib -try: - import simplejson as json # pylint: disable=F0401 -except ImportError: - try: - import json # pylint: disable=F0401 - except ImportError: - # Import the one included in depot_tools. - sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) - import simplejson as json # pylint: disable=F0401 - import breakpad # pylint: disable=W0611 import gcl @@ -744,8 +735,6 @@ def TryChange(argv, elif options.issue and options.patchset is None: # Retrieve the patch from rietveld when the diff is not specified. # When patchset is specified, it's because it's done by gcl/git-try. - if json is None: - parser.error('json or simplejson library is missing, please install.') api_url = '%s/api/%d' % (options.rietveld_url, options.issue) logging.debug(api_url) contents = json.loads(urllib.urlopen(api_url).read())