Commit f6228e15 authored by Gavin Mak's avatar Gavin Mak Committed by LUCI CQ

Revert "Add python3 support to bot_update recipe module"

This reverts commit edb6e8c5.

Reason for revert: missing some py3 changes 

Original change's description:
> Add python3 support to bot_update recipe module
>
> Bug: 1227140
> Change-Id: Id4938c966da54957f84f59d0aef0c68c381ad5f6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3016032
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Gavin Mak <gavinmak@google.com>

Bug: 1227140
Change-Id: If0852908b112ff6bdd4152189c7cb198eebd2c22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3022309
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
parent 049acc48
......@@ -5,9 +5,9 @@
# TODO(hinoka): Use logging.
from __future__ import division
from __future__ import print_function
import cStringIO
import codecs
from contextlib import contextmanager
import copy
......@@ -18,24 +18,19 @@ import json
import optparse
import os
import pprint
import random
import re
import subprocess
import sys
import tempfile
import threading
import time
import urllib2
import urlparse
import uuid
import os.path as path
# TODO(crbug.com/1227140): Clean up when py2 is no longer supported.
try:
from cStringIO import StringIO
import urlparse
except ImportError: # pragma: no cover
from io import StringIO
import urllib.parse as urlparse
# How many bytes at a time to read from pipes.
BUF_SIZE = 256
......@@ -175,7 +170,7 @@ def call(*args, **kwargs): # pragma: no cover
stdin_data = kwargs.pop('stdin_data', None)
if stdin_data:
kwargs['stdin'] = subprocess.PIPE
out = StringIO()
out = cStringIO.StringIO()
new_env = kwargs.get('env', {})
env = os.environ.copy()
env.update(new_env)
......@@ -460,7 +455,7 @@ def create_manifest():
for path, info in json.load(f).items()
if info['rev'] is not None
}
except (ValueError, SubprocessFailed):
except ValueError, SubprocessFailed:
return {}
finally:
os.remove(fname)
......@@ -603,7 +598,7 @@ def _maybe_break_locks(checkout_path, tries=3):
print('FAILED to break lock: %s: %s' % (to_break, ex))
raise
for _ in range(tries):
for _ in xrange(tries):
try:
attempt()
return
......
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