Remove deadcode from depot_tools scripts

Removing some deadcode from depot_tools scripts. More follow-up CLs will
be made after this to remove more dead code.

R=sokcevic,gavinmak

Change-Id: Iad20e9e1737e49c1370248d32c6317cf2be63de4
Bug: 1475776
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811216
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
changes/16/4811216/4
Aravind Vasudevan 2 years ago committed by LUCI CQ
parent c1c1fb626b
commit ed935cf29b

@ -24,10 +24,8 @@ import json
import argparse
import os
import pipes
import re
import subprocess
import sys
import textwrap
import git_common

@ -128,12 +128,8 @@ class GNException(Exception):
pass
def ToGNString(value, allow_dicts = True):
"""Returns a stringified GN equivalent of the Python value.
allow_dicts indicates if this function will allow converting dictionaries
to GN scopes. This is only possible at the top level, you can't nest a
GN scope in a list, so this should be set to False for recursive calls."""
def ToGNString(value):
"""Returns a stringified GN equivalent of the Python value."""
if isinstance(value, str):
if value.find('\n') >= 0:
raise GNException("Trying to print a string with a newline in it.")

@ -1359,7 +1359,7 @@ class GitWrapper(SCMWrapper):
os.path.isdir(os.path.join(g, "rebase-merge")) or
os.path.isdir(os.path.join(g, "rebase-apply")))
def _CheckClean(self, revision, fixup=False):
def _CheckClean(self, revision):
lockfile = os.path.join(self.checkout_path, ".git", "index.lock")
if os.path.exists(lockfile):
raise gclient_utils.Error(

@ -29,7 +29,6 @@ from __future__ import print_function
import argparse
import collections
import metrics
import os
import subprocess2
import sys

@ -10,7 +10,6 @@ import functools
import json
import os
import sys
import tempfile
import threading
import time
import traceback

@ -56,8 +56,6 @@ class MetricsCollectorTest(unittest.TestCase):
# Patch the methods used to get the system information, so we have a known
# environment.
mock.patch('metrics.tempfile.mkstemp',
lambda: (None, '/tmp/metrics.json')).start()
mock.patch('metrics.time.time',
TimeMock()).start()
mock.patch('metrics.metrics_utils.get_python_version',

Loading…
Cancel
Save