diff --git a/engine/src/flutter/build/copy_info_plist.py b/engine/src/flutter/build/copy_info_plist.py index a87e1a8c98..f393039121 100644 --- a/engine/src/flutter/build/copy_info_plist.py +++ b/engine/src/flutter/build/copy_info_plist.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -13,9 +13,9 @@ Precondition: $CWD/../../flutter is the path to the flutter engine repo. usage: copy_info_plist.py --bitcode= """ -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function + + + import subprocess import sys diff --git a/engine/src/flutter/build/dart/tools/dart_package_name.py b/engine/src/flutter/build/dart/tools/dart_package_name.py index 255ef5be7a..db8c9e9319 100755 --- a/engine/src/flutter/build/dart/tools/dart_package_name.py +++ b/engine/src/flutter/build/dart/tools/dart_package_name.py @@ -1,4 +1,5 @@ -#!/usr/bin/python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/build/dart/tools/dart_pkg.py b/engine/src/flutter/build/dart/tools/dart_pkg.py index 18d2e6951f..09c7403eab 100755 --- a/engine/src/flutter/build/dart/tools/dart_pkg.py +++ b/engine/src/flutter/build/dart/tools/dart_pkg.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -81,7 +81,7 @@ def copy(from_root, to_root, filter_func=None): os.makedirs(to_dir) shutil.copy(from_path, to_path) - dirs[:] = filter(wrapped_filter, dirs) + dirs[:] = list(filter(wrapped_filter, dirs)) def copy_or_link(from_root, to_root, filter_func=None): @@ -114,7 +114,7 @@ def list_files(from_root, filter_func=None): for name in filter(wrapped_filter, files): path = os.path.join(root, name) file_list.append(path) - dirs[:] = filter(wrapped_filter, dirs) + dirs[:] = list(filter(wrapped_filter, dirs)) return file_list diff --git a/engine/src/flutter/build/generate_coverage.py b/engine/src/flutter/build/generate_coverage.py index bf675eca09..4beecddb06 100755 --- a/engine/src/flutter/build/generate_coverage.py +++ b/engine/src/flutter/build/generate_coverage.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -84,7 +84,7 @@ def main(): RemoveIfExists(raw_profile) - print "Running test %s to gather profile." % os.path.basename(absolute_test_path) + print("Running test %s to gather profile." % os.path.basename(absolute_test_path)) test_command = [absolute_test_path] diff --git a/engine/src/flutter/build/git_revision.py b/engine/src/flutter/build/git_revision.py index 5ee807c3ab..c724f22480 100755 --- a/engine/src/flutter/build/git_revision.py +++ b/engine/src/flutter/build/git_revision.py @@ -1,13 +1,13 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Get the Git HEAD revision of a specified Git repository.""" -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function + + + import sys import subprocess diff --git a/engine/src/flutter/build/zip.py b/engine/src/flutter/build/zip.py index b257a7ad3c..0bcbc02fc9 100755 --- a/engine/src/flutter/build/zip.py +++ b/engine/src/flutter/build/zip.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/ci/firebase_testlab.py b/engine/src/flutter/ci/firebase_testlab.py index 7aef50c379..effd543819 100755 --- a/engine/src/flutter/ci/firebase_testlab.py +++ b/engine/src/flutter/ci/firebase_testlab.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/ci/licenses_golden/tool_signature b/engine/src/flutter/ci/licenses_golden/tool_signature index 994a643c46..5ee671d62f 100644 --- a/engine/src/flutter/ci/licenses_golden/tool_signature +++ b/engine/src/flutter/ci/licenses_golden/tool_signature @@ -1,2 +1,2 @@ -Signature: 17e2c7f169a5804317b8f79ab1f8a838 +Signature: fdaf33383efb94fa6bbc158cbc25635c diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/build/asset_package.py b/engine/src/flutter/shell/platform/fuchsia/flutter/build/asset_package.py index 90c98fdd2f..5ec916f5ff 100755 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/build/asset_package.py +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/build/asset_package.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py b/engine/src/flutter/shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py index c16a6feca7..d5811d5cdd 100755 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/create_ios_framework.py b/engine/src/flutter/sky/tools/create_ios_framework.py index 6ceaa658f3..67092cac3b 100755 --- a/engine/src/flutter/sky/tools/create_ios_framework.py +++ b/engine/src/flutter/sky/tools/create_ios_framework.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py b/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py index af833076fe..301f91cf28 100755 --- a/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py +++ b/engine/src/flutter/sky/tools/create_macos_gen_snapshots.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/create_xcframework.py b/engine/src/flutter/sky/tools/create_xcframework.py index 0bdc952e61..774a3ef90d 100755 --- a/engine/src/flutter/sky/tools/create_xcframework.py +++ b/engine/src/flutter/sky/tools/create_xcframework.py @@ -1,11 +1,12 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -from __future__ import absolute_import -from __future__ import division -from __future__ import print_function + + + import argparse import errno diff --git a/engine/src/flutter/sky/tools/dist_dart_pkg.py b/engine/src/flutter/sky/tools/dist_dart_pkg.py index af8bd1dbb2..2a01a571e3 100755 --- a/engine/src/flutter/sky/tools/dist_dart_pkg.py +++ b/engine/src/flutter/sky/tools/dist_dart_pkg.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/flutter_gdb b/engine/src/flutter/sky/tools/flutter_gdb index 0d2fa2adb8..fd7fec060e 100755 --- a/engine/src/flutter/sky/tools/flutter_gdb +++ b/engine/src/flutter/sky/tools/flutter_gdb @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -39,7 +40,7 @@ def _find_package_pid(adb_path, package): ps_output = subprocess.check_output([adb_path, 'shell', 'ps']) ps_match = re.search('^\S+\s+(\d+).*\s%s' % package, ps_output, re.MULTILINE) if not ps_match: - print 'Unable to find pid for package %s on device' % package + print('Unable to find pid for package %s on device' % package) return None return int(ps_match.group(1)) @@ -114,7 +115,7 @@ class GdbClient(object): dev_null = open(os.devnull, 'w') for lib, local_path in sorted(device_libs): - print 'Copying %s' % lib + print('Copying %s' % lib) local_path = os.path.join(GdbClient.SYSTEM_LIBS_PATH, local_path) if not os.path.exists(os.path.dirname(local_path)): os.makedirs(os.path.dirname(local_path)) @@ -144,7 +145,7 @@ class GdbClient(object): debug_out_path = os.path.join(flutter_root, 'out/%s' % local_engine) if not os.path.exists(os.path.join(debug_out_path, 'libflutter.so')): - print 'Unable to find libflutter.so. Make sure you have completed a %s build' % local_engine + print('Unable to find libflutter.so. Make sure you have completed a %s build' % local_engine) return 1 eval_commands = [] diff --git a/engine/src/flutter/sky/tools/install_framework_headers.py b/engine/src/flutter/sky/tools/install_framework_headers.py index a746ff90b0..1defe100b1 100755 --- a/engine/src/flutter/sky/tools/install_framework_headers.py +++ b/engine/src/flutter/sky/tools/install_framework_headers.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/objcopy.py b/engine/src/flutter/sky/tools/objcopy.py index b8da36d43b..ed2256bc5f 100755 --- a/engine/src/flutter/sky/tools/objcopy.py +++ b/engine/src/flutter/sky/tools/objcopy.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/sky/tools/roll/patch.py b/engine/src/flutter/sky/tools/roll/patch.py index f08b610e31..1ffc6a88aa 100755 --- a/engine/src/flutter/sky/tools/roll/patch.py +++ b/engine/src/flutter/sky/tools/roll/patch.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -33,10 +34,10 @@ def patch(dest_dir, relative_patches_dir=os.curdir): os.chdir(dest_dir) for p in utils.find(["*.patch"], patches_dir): - print "applying patch %s" % os.path.basename(p) + print("applying patch %s" % os.path.basename(p)) try: utils.system(["git", "apply", p]) utils.commit("applied patch %s" % os.path.basename(p)) except subprocess.CalledProcessError: - print "ERROR: patch %s failed to apply" % os.path.basename(p) + print("ERROR: patch %s failed to apply" % os.path.basename(p)) raise diff --git a/engine/src/flutter/sky/tools/roll/roll.py b/engine/src/flutter/sky/tools/roll/roll.py index c4d322cb9c..a4d03aabdc 100755 --- a/engine/src/flutter/sky/tools/roll/roll.py +++ b/engine/src/flutter/sky/tools/roll/roll.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -8,7 +9,7 @@ import json import os import subprocess import sys -import urllib2 +import urllib.request, urllib.error, urllib.parse from utils import commit from utils import system import patch @@ -96,12 +97,12 @@ def rev(source_dir, dest_dir, dirs_to_rev, name, revision_file=None): else: d = dir_to_rev file_subset = None - print "removing directory %s" % d + print("removing directory %s" % d) try: system(["git", "rm", "-r", d], cwd=dest_dir) except subprocess.CalledProcessError: - print "Could not remove %s" % d - print "cloning directory %s" % d + print("Could not remove %s" % d) + print("cloning directory %s" % d) if file_subset is None: files = system(["git", "ls-files", d], cwd=source_dir).splitlines() @@ -151,8 +152,8 @@ def main(): try: patch.patch_and_filter(dest_dir, os.path.join('patches', 'chromium')) except subprocess.CalledProcessError: - print "ERROR: Roll failed due to a patch not applying" - print "Fix the patch to apply, commit the result, and re-run this script" + print("ERROR: Roll failed due to a patch not applying") + print("Fix the patch to apply, commit the result, and re-run this script") return 1 return 0 diff --git a/engine/src/flutter/sky/tools/roll/utils.py b/engine/src/flutter/sky/tools/roll/utils.py index c14732e34d..c5008eec30 100755 --- a/engine/src/flutter/sky/tools/roll/utils.py +++ b/engine/src/flutter/sky/tools/roll/utils.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/testing/rules/run_gradle.py b/engine/src/flutter/testing/rules/run_gradle.py index 41bb007ea6..cdde9a818e 100644 --- a/engine/src/flutter/testing/rules/run_gradle.py +++ b/engine/src/flutter/testing/rules/run_gradle.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/testing/run_tests.py b/engine/src/flutter/testing/run_tests.py index 50eea3b983..9f2553a970 100755 --- a/engine/src/flutter/testing/run_tests.py +++ b/engine/src/flutter/testing/run_tests.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -27,17 +28,17 @@ fml_unittests_filter = '--gtest_filter=-*TimeSensitiveTest*' def PrintDivider(char='='): - print '\n' - for _ in xrange(4): - print(''.join([char for _ in xrange(80)])) - print '\n' + print('\n') + for _ in range(4): + print(''.join([char for _ in range(80)])) + print('\n') def RunCmd(cmd, forbidden_output=[], expect_failure=False, env=None, **kwargs): command_string = ' '.join(cmd) PrintDivider('>') - print 'Running command "%s"' % command_string + print('Running command "%s"' % command_string) start_time = time.time() stdout_pipe = sys.stdout if not forbidden_output else subprocess.PIPE @@ -70,7 +71,7 @@ def RunCmd(cmd, forbidden_output=[], expect_failure=False, env=None, **kwargs): raise Exception('command "%s" contained forbidden string %s' % (command_string, forbidden_string)) PrintDivider('<') - print 'Command run successfully in %.2f seconds: %s' % (end_time - start_time, command_string) + print('Command run successfully in %.2f seconds: %s' % (end_time - start_time, command_string)) def IsMac(): @@ -146,7 +147,7 @@ def RunEngineExecutable(build_dir, executable_name, filter, flags=[], core_path = os.path.join(cwd, 'core') if luci_test_outputs_path and os.path.exists(core_path) and os.path.exists(unstripped_exe): dump_path = os.path.join(luci_test_outputs_path, '%s_%s.txt' % (executable_name, sys.platform)) - print 'Writing core dump analysis to %s' % dump_path + print('Writing core dump analysis to %s' % dump_path) subprocess.call([ os.path.join(buildroot_dir, 'flutter', 'testing', 'analyze_core_dump.sh'), buildroot_dir, unstripped_exe, core_path, dump_path, @@ -341,12 +342,12 @@ def RunJavaTests(filter, android_variant='android_debug_unopt'): EnsureJavaTestsAreBuilt(android_out_dir) embedding_deps_dir = os.path.join(buildroot_dir, 'third_party', 'android_embedding_dependencies', 'lib') - classpath = map(str, [ + classpath = list(map(str, [ os.path.join(buildroot_dir, 'third_party', 'android_tools', 'sdk', 'platforms', 'android-30', 'android.jar'), os.path.join(embedding_deps_dir, '*'), # Wildcard for all jars in the directory os.path.join(android_out_dir, 'flutter.jar'), os.path.join(android_out_dir, 'robolectric_tests.jar') - ]) + ])) test_class = filter if filter else 'io.flutter.FlutterTestSuite' command = [ diff --git a/engine/src/flutter/tools/android_illegal_imports.py b/engine/src/flutter/tools/android_illegal_imports.py index e07573f141..6c292bea12 100644 --- a/engine/src/flutter/tools/android_illegal_imports.py +++ b/engine/src/flutter/tools/android_illegal_imports.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/tools/androidx/generate_pom_file.py b/engine/src/flutter/tools/androidx/generate_pom_file.py index b2cd3deac3..10fe63338c 100644 --- a/engine/src/flutter/tools/androidx/generate_pom_file.py +++ b/engine/src/flutter/tools/androidx/generate_pom_file.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2019 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/tools/dia_dll.py b/engine/src/flutter/tools/dia_dll.py index 9366349878..010ed4f1ee 100644 --- a/engine/src/flutter/tools/dia_dll.py +++ b/engine/src/flutter/tools/dia_dll.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/tools/font-subset/test.py b/engine/src/flutter/tools/font-subset/test.py index d97aa4f9f0..977dec352b 100755 --- a/engine/src/flutter/tools/font-subset/test.py +++ b/engine/src/flutter/tools/font-subset/test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py index a954230bc4..861b6eef81 100755 --- a/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py +++ b/engine/src/flutter/tools/fuchsia/build_fuchsia_artifacts.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/compile_cml.py b/engine/src/flutter/tools/fuchsia/compile_cml.py index 36acd818a4..ae058d2f53 100755 --- a/engine/src/flutter/tools/fuchsia/compile_cml.py +++ b/engine/src/flutter/tools/fuchsia/compile_cml.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/copy_debug_symbols.py b/engine/src/flutter/tools/fuchsia/copy_debug_symbols.py index 4d4cdaef68..cc415eb59d 100755 --- a/engine/src/flutter/tools/fuchsia/copy_debug_symbols.py +++ b/engine/src/flutter/tools/fuchsia/copy_debug_symbols.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/copy_path.py b/engine/src/flutter/tools/fuchsia/copy_path.py index 1dd4693237..335c262ce3 100755 --- a/engine/src/flutter/tools/fuchsia/copy_path.py +++ b/engine/src/flutter/tools/fuchsia/copy_path.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/gather_flutter_runner_artifacts.py b/engine/src/flutter/tools/fuchsia/gather_flutter_runner_artifacts.py index b337deeadd..942d02fed1 100755 --- a/engine/src/flutter/tools/fuchsia/gather_flutter_runner_artifacts.py +++ b/engine/src/flutter/tools/fuchsia/gather_flutter_runner_artifacts.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -58,7 +58,7 @@ def GatherArtifacts(src_root, dst_root, create_meta_package=True): else: shutil.rmtree(dst_root) - for src_rel, dst_rel in _ARTIFACT_PATH_TO_DST.iteritems(): + for src_rel, dst_rel in _ARTIFACT_PATH_TO_DST.items(): src_full = os.path.join(src_root, src_rel) dst_full = os.path.join(dst_root, dst_rel) if not os.path.exists(src_full): diff --git a/engine/src/flutter/tools/fuchsia/gen_package.py b/engine/src/flutter/tools/fuchsia/gen_package.py index 873356f7c6..c9bd85b74a 100755 --- a/engine/src/flutter/tools/fuchsia/gen_package.py +++ b/engine/src/flutter/tools/fuchsia/gen_package.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/gen_repo.py b/engine/src/flutter/tools/fuchsia/gen_repo.py index 84a72603ce..604fe33cb2 100755 --- a/engine/src/flutter/tools/fuchsia/gen_repo.py +++ b/engine/src/flutter/tools/fuchsia/gen_repo.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/interpolate_test_suite.py b/engine/src/flutter/tools/fuchsia/interpolate_test_suite.py index 0e484ded02..3e61f6520f 100755 --- a/engine/src/flutter/tools/fuchsia/interpolate_test_suite.py +++ b/engine/src/flutter/tools/fuchsia/interpolate_test_suite.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/make_build_info.py b/engine/src/flutter/tools/fuchsia/make_build_info.py index 4e79f8512b..d4565702a1 100644 --- a/engine/src/flutter/tools/fuchsia/make_build_info.py +++ b/engine/src/flutter/tools/fuchsia/make_build_info.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py b/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py index 6b5786d207..e1c71b6eb9 100755 --- a/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py +++ b/engine/src/flutter/tools/fuchsia/merge_and_upload_debug_symbols.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -167,7 +167,7 @@ def main(): out_dir = args.out_dir if os.path.exists(out_dir): - print 'Directory: %s is not empty, deleting it.' % out_dir + print('Directory: %s is not empty, deleting it.' % out_dir) shutil.rmtree(out_dir) os.makedirs(out_dir) diff --git a/engine/src/flutter/tools/fuchsia/parse_manifest.py b/engine/src/flutter/tools/fuchsia/parse_manifest.py index bb7e4917e3..3863e6bae3 100755 --- a/engine/src/flutter/tools/fuchsia/parse_manifest.py +++ b/engine/src/flutter/tools/fuchsia/parse_manifest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be diff --git a/engine/src/flutter/tools/gen_android_buildconfig.py b/engine/src/flutter/tools/gen_android_buildconfig.py index f54c8723e9..485d8f9998 100644 --- a/engine/src/flutter/tools/gen_android_buildconfig.py +++ b/engine/src/flutter/tools/gen_android_buildconfig.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/tools/gen_javadoc.py b/engine/src/flutter/tools/gen_javadoc.py index f19d2dda40..b91096f79e 100755 --- a/engine/src/flutter/tools/gen_javadoc.py +++ b/engine/src/flutter/tools/gen_javadoc.py @@ -1,4 +1,5 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 +# # Copyright 2013 The Flutter Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. diff --git a/engine/src/flutter/tools/licenses/lib/main.dart b/engine/src/flutter/tools/licenses/lib/main.dart index 2122f20b9e..3adbbf6a36 100644 --- a/engine/src/flutter/tools/licenses/lib/main.dart +++ b/engine/src/flutter/tools/licenses/lib/main.dart @@ -77,7 +77,7 @@ class _RepositorySourceFile extends _RepositoryLicensedFile { fs.TextFile get ioTextFile => super.io as fs.TextFile; - static final RegExp _hashBangPattern = RegExp(r'^#! *(?:/bin/sh|/bin/bash|/usr/bin/env +(?:python|bash))\b'); + static final RegExp _hashBangPattern = RegExp(r'^#! *(?:/bin/sh|/bin/bash|/usr/bin/env +(?:python|python3|bash))\b'); @override bool get isShellScript {