Commit 4f6852cc authored by maruel@chromium.org's avatar maruel@chromium.org

Remove python 2.5 compatibility code.

R=cmp@chromium.org
BUG=
TEST=


Review URL: http://codereview.chromium.org/10165007

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@133265 0039d316-1c4b-4281-b951-d872f2087c98
parent e9b272ac
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
Includes support for svn, git-svn and git. Includes support for svn, git-svn and git.
""" """
from __future__ import with_statement
import ConfigParser import ConfigParser
import fnmatch import fnmatch
import logging import logging
......
...@@ -8,6 +8,7 @@ Wrapper script around Rietveld's upload.py that simplifies working with groups ...@@ -8,6 +8,7 @@ Wrapper script around Rietveld's upload.py that simplifies working with groups
of files. of files.
""" """
import json
import optparse import optparse
import os import os
import random import random
...@@ -20,15 +21,6 @@ import urllib2 ...@@ -20,15 +21,6 @@ import urllib2
import breakpad # pylint: disable=W0611 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 fix_encoding
import gclient_utils import gclient_utils
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
"""A git-command for integrating reviews on Rietveld.""" """A git-command for integrating reviews on Rietveld."""
import json
import logging import logging
import optparse import optparse
import os import os
...@@ -23,16 +24,6 @@ try: ...@@ -23,16 +24,6 @@ try:
except ImportError: except ImportError:
pass 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 from third_party import upload
import breakpad # pylint: disable=W0611 import breakpad # pylint: disable=W0611
......
...@@ -695,9 +695,6 @@ def CheckRietveldTryJobExecution(input_api, output_api, host_url, platforms, ...@@ -695,9 +695,6 @@ def CheckRietveldTryJobExecution(input_api, output_api, host_url, platforms,
def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings, def CheckBuildbotPendingBuilds(input_api, output_api, url, max_pendings,
ignored): ignored):
if not input_api.json:
return [output_api.PresubmitPromptWarning(
'Please install simplejson or upgrade to python 2.6+')]
try: try:
connection = input_api.urllib2.urlopen(url) connection = input_api.urllib2.urlopen(url)
raw_data = connection.read() raw_data = connection.read()
......
...@@ -17,6 +17,7 @@ import cStringIO # Exposed through the API. ...@@ -17,6 +17,7 @@ import cStringIO # Exposed through the API.
import fnmatch import fnmatch
import glob import glob
import inspect import inspect
import json # Exposed through the API.
import logging import logging
import marshal # Exposed through the API. import marshal # Exposed through the API.
import optparse import optparse
...@@ -33,16 +34,6 @@ import unittest # Exposed through the API. ...@@ -33,16 +34,6 @@ import unittest # Exposed through the API.
import urllib2 # Exposed through the API. import urllib2 # Exposed through the API.
from warnings import warn 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. # Local imports.
import fix_encoding import fix_encoding
import gclient_utils import gclient_utils
......
...@@ -13,23 +13,12 @@ The following hypothesis are made: ...@@ -13,23 +13,12 @@ The following hypothesis are made:
- A patch set cannot be modified - A patch set cannot be modified
""" """
import json
import logging import logging
import os
import re import re
import sys
import time import time
import urllib2 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 from third_party import upload
import patch import patch
......
# coding=utf8 # 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 # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
"""Collection of subprocess wrapper functions. """Collection of subprocess wrapper functions.
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
In theory you shouldn't need anything else in subprocess, or this module failed. In theory you shouldn't need anything else in subprocess, or this module failed.
""" """
from __future__ import with_statement
import cStringIO import cStringIO
import errno import errno
import logging import logging
......
#!/usr/bin/env python #!/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 # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
"""Unit tests for checkout.py.""" """Unit tests for checkout.py."""
from __future__ import with_statement
import logging import logging
import os import os
import shutil import shutil
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
See gclient_smoketest.py for integration tests. See gclient_smoketest.py for integration tests.
""" """
from __future__ import with_statement
import Queue import Queue
import logging import logging
import os import os
......
#!/usr/bin/env python #!/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 # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
"""Unit tests for scm.py.""" """Unit tests for scm.py."""
from __future__ import with_statement
import logging import logging
import os import os
import sys import sys
......
...@@ -11,6 +11,7 @@ to the server by HTTP. ...@@ -11,6 +11,7 @@ to the server by HTTP.
import datetime import datetime
import errno import errno
import getpass import getpass
import json
import logging import logging
import optparse import optparse
import os import os
...@@ -21,16 +22,6 @@ import sys ...@@ -21,16 +22,6 @@ import sys
import tempfile import tempfile
import urllib 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 breakpad # pylint: disable=W0611
import gcl import gcl
...@@ -744,8 +735,6 @@ def TryChange(argv, ...@@ -744,8 +735,6 @@ def TryChange(argv,
elif options.issue and options.patchset is None: elif options.issue and options.patchset is None:
# Retrieve the patch from rietveld when the diff is not specified. # 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. # 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) api_url = '%s/api/%d' % (options.rietveld_url, options.issue)
logging.debug(api_url) logging.debug(api_url)
contents = json.loads(urllib.urlopen(api_url).read()) contents = json.loads(urllib.urlopen(api_url).read())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment