Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4f2e9dc

Browse files
committed
Migrate all Python hashbangs to Python 3
Migrates all `#!/usr/bin/env python` hashbang lines to use python3. Issue: flutter/flutter#83043
1 parent c555dc0 commit 4f2e9dc

39 files changed

+60
-39
lines changed

build/copy_info_plist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

build/dart/tools/dart_package_name.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

build/dart/tools/dart_pkg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

build/generate_coverage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

build/git_revision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

build/zip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

ci/firebase_testlab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

shell/platform/fuchsia/flutter/build/asset_package.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

shell/platform/fuchsia/flutter/build/gen_debug_wrapper_main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/create_ios_framework.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/create_macos_gen_snapshots.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/create_xcframework.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/dist_dart_pkg.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/flutter_gdb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/install_framework_headers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/objcopy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/roll/patch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/roll/roll.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

sky/tools/roll/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

testing/rules/run_gradle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

testing/run_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/android_illegal_imports.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/androidx/generate_pom_file.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2019 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/dia_dll.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/font-subset/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/build_fuchsia_artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/compile_cml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/copy_debug_symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/copy_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/gather_flutter_runner_artifacts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/gen_package.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/gen_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/interpolate_test_suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/make_build_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/merge_and_upload_debug_symbols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/fuchsia/parse_manifest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
22
#
33
# Copyright 2013 The Flutter Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

tools/gen_android_buildconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/gen_javadoc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python3
2+
#
23
# Copyright 2013 The Flutter Authors. All rights reserved.
34
# Use of this source code is governed by a BSD-style license that can be
45
# found in the LICENSE file.

tools/licenses/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class _RepositorySourceFile extends _RepositoryLicensedFile {
7777

7878
fs.TextFile get ioTextFile => super.io as fs.TextFile;
7979

80-
static final RegExp _hashBangPattern = RegExp(r'^#! *(?:/bin/sh|/bin/bash|/usr/bin/env +(?:python|bash))\b');
80+
static final RegExp _hashBangPattern = RegExp(r'^#! *(?:/bin/sh|/bin/bash|/usr/bin/env +(?:python|python3|bash))\b');
8181

8282
@override
8383
bool get isShellScript {

0 commit comments

Comments
 (0)