Commit 4de5deac authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Explicitly run everything with python3

R=aravindvasudev@google.com, gavinmak@google.com

Change-Id: Iaa5e960c6226dea3a0814c7cb778d952eafb1502
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3525960Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
Reviewed-by: 's avatarAravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent 075cd76f
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env vpython #!/usr/bin/env vpython3
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2013 The Chromium Authors. All rights reserved. # Copyright 2013 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env vpython #!/usr/bin/env vpython3
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Copyright (c) 2013 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2016 The Chromium Authors. All rights reserved. # Copyright 2016 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
"""Generic retry wrapper for Git operations. """Generic retry wrapper for Git operations.
This is largely DEPRECATED in favor of the Infra Git wrapper: This is largely DEPRECATED in favor of the Infra Git wrapper:
https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git https://chromium.googlesource.com/infra/infra/+/HEAD/go/src/infra/tools/git
...@@ -95,7 +95,7 @@ class GitRetry(object): ...@@ -95,7 +95,7 @@ class GitRetry(object):
def __call__(self, *args): def __call__(self, *args):
returncode = 0 returncode = 0
for i in xrange(self.retry_count): for i in range(self.retry_count):
# If the previous run failed and a delay is configured, delay before the # If the previous run failed and a delay is configured, delay before the
# next run. # next run.
delay = self.computeDelay(i) delay = self.computeDelay(i)
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2018 The Chromium Authors. All rights reserved. # Copyright (c) 2018 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.
...@@ -62,7 +62,7 @@ class _Config(object): ...@@ -62,7 +62,7 @@ class _Config(object):
self._initialized = True self._initialized = True
return return
# We are running on a bot. Ignore config and collect metrics. # We are running on a bot. Ignore config and collect metrics.
if metrics_utils.REPORT_BUILD: if metrics_utils.REPORT_BUILD:
self._config = { self._config = {
'is-googler': True, 'is-googler': True,
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2018 The Chromium Authors. All rights reserved. # Copyright (c) 2018 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2021 The Chromium Authors. All rights reserved. # Copyright (c) 2021 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2012 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.
...@@ -734,9 +734,11 @@ class InputApi(object): ...@@ -734,9 +734,11 @@ class InputApi(object):
' is deprecated and ignored' % str(include_deletes), ' is deprecated and ignored' % str(include_deletes),
category=DeprecationWarning, category=DeprecationWarning,
stacklevel=2) stacklevel=2)
return list(filter( # pylint: disable=consider-using-generator
lambda x: x.IsTestableFile(), return [
self.AffectedFiles(include_deletes=False, **kwargs))) x for x in self.AffectedFiles(include_deletes=False, **kwargs)
if x.IsTestableFile()
]
def AffectedTextFiles(self, include_deletes=None): def AffectedTextFiles(self, include_deletes=None):
"""An alias to AffectedTestableFiles for backwards compatibility.""" """An alias to AffectedTestableFiles for backwards compatibility."""
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2019 The Chromium Authors. All rights reserved. # Copyright 2019 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.
......
#!/usr/bin/env vpython #!/usr/bin/env vpython3
# Copyright (c) 2020 The Chromium Authors. All rights reserved. # Copyright (c) 2020 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# -*- coding:utf-8 -*- # -*- coding:utf-8 -*-
# #
# Copyright (C) 2008 The Android Open Source Project # Copyright (C) 2008 The Android Open Source Project
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2015 The Chromium Authors. All rights reserved. # Copyright 2015 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2016 The Chromium Authors. All rights reserved. # Copyright (c) 2016 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2017 The Chromium Authors. All rights reserved. # Copyright 2017 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2019 The Chromium Authors. All rights reserved. # Copyright (c) 2019 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.
......
...@@ -233,18 +233,22 @@ def create_archives(dirs): ...@@ -233,18 +233,22 @@ def create_archives(dirs):
def validate_archive_dirs(dirs): def validate_archive_dirs(dirs):
# We don't allow .. in paths in our archives. for d in dirs:
if any(map(lambda x: '..' in x, dirs)): # We don't allow .. in paths in our archives.
return False if d == '..':
# We only allow dirs. return False
if any(map(lambda x: not os.path.isdir(x), dirs)): # We only allow dirs.
return False if not os.path.isdir(d):
# We don't allow sym links in our archives. return False
if any(map(os.path.islink, dirs)): # We don't allow sym links in our archives.
return False if os.path.islink(d):
# We required that the subdirectories we are archiving are all just below return False
# cwd. # We required that the subdirectories we are archiving are all just below
return not any(map(lambda x: x not in next(os.walk('.'))[1], dirs)) # cwd.
if d not in next(os.walk('.'))[1]:
return False
return True
def main(): def main():
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Copyright (c) 2011 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Copyright (c) 2010 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2013 The Chromium Authors. All rights reserved. # Copyright 2013 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright 2014 The Chromium Authors. All rights reserved. # Copyright 2014 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.
......
#!/usr/bin/env python #!/usr/bin/env python3
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Copyright (c) 2010 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.
...@@ -71,8 +71,8 @@ def main(): ...@@ -71,8 +71,8 @@ def main():
# We want to use the full path for testing, but we want to use the relative # We want to use the full path for testing, but we want to use the relative
# path for display. # path for display.
fulldirs = map(lambda(p): os.path.normpath(os.path.join(root, p)), raw) fulldirs = [os.path.normpath(os.path.join(root, p)) for p in raw]
reldirs = map(lambda(p): re.sub('^' + base, '.', p), raw) reldirs = [re.sub('^' + base, '.', p) for p in raw]
for full_path, relative_path in zip(fulldirs, reldirs): for full_path, relative_path in zip(fulldirs, reldirs):
show_dir(full_path, relative_path, color) show_dir(full_path, relative_path, color)
......
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