Remove __future__ imports

All __future__ imports (unicode_literals, print_function) are already
mandatory in py3. Also remove an outdated py2 comment in
presubmit_canned_checks.py

Bug: 1475402
Change-Id: I27cf6a8268f6dd1081f22af782c4c29a975376ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4867135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
changes/35/4867135/3
Gavin Mak 2 years ago committed by LUCI CQ
parent c5505889cf
commit f936d540e1

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""Google OAuth2 related functions."""
from __future__ import print_function
import collections
import datetime
import functools

@ -8,8 +8,6 @@ clang-format binaries are pulled down from Google Cloud Storage whenever you
sync Chrome, to platform-specific locations. This script knows how to locate
those tools, assuming the script is invoked from inside a Chromium checkout."""
from __future__ import print_function
import gclient_paths
import os
import subprocess

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
import os
import subprocess

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Outputs host CPU architecture in format recognized by gyp."""
from __future__ import print_function
import platform
import re

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Download files from Google Storage based on SHA1 sums."""
from __future__ import print_function
import hashlib
import optparse
import os

@ -17,8 +17,6 @@ Optional arguments may be passed on the command line in key-value pairs.
These parameters will be passed through to the config's main method.
"""
from __future__ import print_function
import json
import argparse
import os

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""This module holds utilities which make writing configs easier."""
from __future__ import print_function
import json

@ -5,8 +5,6 @@
multiple platforms with python.
"""
from __future__ import print_function
import codecs
import locale
import os

@ -11,8 +11,6 @@ binary. It will also automatically try to find the gn binary when run inside
the chrome source tree, so users can just type "gn" on the command line
(normally depot_tools is on the path)."""
from __future__ import print_function
import gclient_paths
import os
import subprocess

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Run a pinned gsutil."""
from __future__ import print_function
import argparse
import base64
import contextlib

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""Exclusive filelocking for all supported platforms."""
from __future__ import print_function
import contextlib
import logging
import os

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import collections
import os
import re

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import argparse
from collections import defaultdict
import os

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import contextlib
import functools
import json

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import re
import os
import scm

@ -32,8 +32,6 @@ To add additional gerrit instances, one can pass a JSON file as parameter:
# check those details to determine if there was activity in the given period.
# This means that query time scales mostly with (today() - begin).
from __future__ import print_function
import collections
import contextlib
from datetime import datetime

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import json
import os
import platform

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""Interactive tool for finding reviewers/owners for a change."""
from __future__ import print_function
import os
import copy

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""Generic presubmit checks that can be reused by other presubmit checks."""
from __future__ import print_function
import io as _io
import os as _os
import zlib
@ -1123,9 +1121,6 @@ def GetPythonUnitTests(input_api, output_api, unit_tests, python3=False):
'.',
input_api.os_path.pathsep.join(['..'] * (cwd.count('/') + 1))
]
# We convert to str, since on Windows on Python 2 only strings are
# allowed as environment variables, but literals are unicode since
# we're importing unicode_literals from __future__.
if env.get('PYTHONPATH'):
backpath.append(env.get('PYTHONPATH'))
env['PYTHONPATH'] = input_api.os_path.pathsep.join((backpath))

@ -5,8 +5,6 @@
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
from __future__ import print_function
__version__ = '2.0.0'
# TODO(joi) Add caching where appropriate/needed. The API is designed to allow

@ -7,8 +7,6 @@
This will be executed by vpython with the right pylint versions.
"""
from __future__ import print_function
import os
import sys

@ -22,8 +22,6 @@ It is used to get an initial repo client checkout, and after that it runs the
copy of repo in the checkout.
"""
from __future__ import print_function
import datetime
import os
import platform

@ -8,8 +8,6 @@ Works only with git checkout and git dependencies. Currently this script will
always roll to the tip of to origin/main.
"""
from __future__ import print_function
import argparse
import itertools
import os

@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import ctypes
import platform
import subprocess

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Splits a branch into smaller branches and uploads CLs."""
from __future__ import print_function
import collections
import os
import re

@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import distutils.version
import os
import sys

@ -5,8 +5,6 @@
# found in the LICENSE file.
"""Generate fake repositories for testing."""
from __future__ import print_function
import atexit
import datetime
import errno

@ -3,8 +3,6 @@
# found in the LICENSE file.
"""Simplify unit tests based on pymox."""
from __future__ import print_function
import os
import random
import string

@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import atexit
import logging
import os

@ -5,8 +5,6 @@
# pylint: disable=protected-access
"""Unit tests for download_from_google_storage.py."""
from __future__ import print_function
import optparse
import os
import queue

@ -5,8 +5,6 @@
# found in the LICENSE file.
"""Unit tests for fix_encoding.py."""
from __future__ import print_function
import os
import sys
import unittest

@ -6,8 +6,6 @@
# pylint: disable=E1103
from __future__ import unicode_literals
from io import StringIO
import json
import logging

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Test gsutil.py."""
from __future__ import unicode_literals
import base64
import hashlib
import io

@ -6,8 +6,6 @@
# pylint: disable=no-member,E1103
from __future__ import unicode_literals
import functools
import io
import itertools

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Unit tests for rdb_wrapper.py"""
from __future__ import print_function
import contextlib
import json
import logging

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Uploads files to Google Storage content addressed."""
from __future__ import print_function
import hashlib
import optparse
import os

@ -17,8 +17,6 @@ the watchers for files given on the command line. This is useful to verify
changes to WATCHLISTS files.
"""
from __future__ import print_function
import logging
import os
import re

@ -5,8 +5,6 @@
"""Display log of checkins of one particular developer since a particular
date. Only works on git dependencies at the moment."""
from __future__ import print_function
import gclient_utils
import optparse
import os

@ -17,8 +17,6 @@ the toolchain. This is likely to be a poorly tested code path that probably
won't be properly maintained. See http://crbug.com/323300.
"""
from __future__ import print_function
import argparse
from contextlib import closing
import hashlib

@ -30,8 +30,6 @@ useful as the resulting zip can't be redistributed, and most will presumably
have a Pro license anyway).
"""
from __future__ import print_function
import collections
import glob
import json

2
wtf

@ -4,8 +4,6 @@
# found in the LICENSE file.
"""Display active git branches and code changes in a chromiumos workspace."""
from __future__ import print_function
import gclient_utils
import os
import re

Loading…
Cancel
Save