Use typing List to work in cros python 3.8

Bug: 337720659
Change-Id: I7953bc95c6e8fb1d9ff794935811464a31d804a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5499917
Reviewed-by: Alvin Jia <alvinjia@google.com>
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Owners-Override: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Alvin Jia <alvinjia@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
changes/17/5499917/2
Joel Hockey 1 year ago committed by LUCI CQ
parent 979678ce51
commit 2c87882a7b

@ -16,6 +16,7 @@ import tarfile
from download_from_google_storage import Gsutil
from download_from_google_storage import GSUTIL_DEFAULT_PATH
from typing import List
MISSING_GENERATION_MSG = (
'missing generation number, please retrieve from Cloud Storage'
@ -47,8 +48,8 @@ find . -name .svn -prune -o -size +1000k -type f -print0 |
"""
def get_targets(args: list[str], parser: optparse.OptionParser,
use_null_terminator: bool) -> list[str]:
def get_targets(args: List[str], parser: optparse.OptionParser,
use_null_terminator: bool) -> List[str]:
"""Get target(s) to upload to GCS"""
if not args:
parser.error('Missing target.')
@ -63,7 +64,7 @@ def get_targets(args: list[str], parser: optparse.OptionParser,
return args
def create_archive(dirs: list[str]) -> str:
def create_archive(dirs: List[str]) -> str:
"""Given a list of directories, compress them all into one tar file"""
# tarfile name cannot have a forward slash or else an error will be
# thrown
@ -74,7 +75,7 @@ def create_archive(dirs: list[str]) -> str:
return filename
def validate_archive_dirs(dirs: list[str]) -> bool:
def validate_archive_dirs(dirs: List[str]) -> bool:
"""Validate the list of directories"""
for d in dirs:
# We don't allow .. in paths in our archives.

Loading…
Cancel
Save