Skip to content

Commit 6cee685

Browse files
authored
Convert all remaining Python 2 scripts to Python 3 (flutter#495)
This applies all remaining migrations in the buildroot, and converts the hashbang lines to invoke python3.
1 parent 630be43 commit 6cee685

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+441
-389
lines changed

build/android/gyp/create_flutter_jar.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 2016 The Chromium Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be

build/android/gyp/jar.py

Lines changed: 2 additions & 3 deletions
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 Chromium Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be
@@ -48,8 +48,7 @@ def Jar(class_files, classes_dir, jar_path, manifest_file=None, additional_jar_f
4848
def JarDirectory(classes_dir, excluded_classes, jar_path, manifest_file=None, additional_jar_files=None):
4949
class_files = build_utils.FindInDirectory(classes_dir, '*.class')
5050
for exclude in excluded_classes:
51-
class_files = filter(
52-
lambda f: not fnmatch.fnmatch(f, exclude), class_files)
51+
class_files = [f for f in class_files if not fnmatch.fnmatch(f, exclude)]
5352

5453
Jar(class_files, classes_dir, jar_path, manifest_file=manifest_file,
5554
additional_jar_files=additional_jar_files)

build/android/gyp/javac.py

Lines changed: 2 additions & 2 deletions
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 Chromium Authors. All rights reserved.
44
# Use of this source code is governed by a BSD-style license that can be
@@ -301,7 +301,7 @@ def main(argv):
301301
if options.jar_path:
302302
if options.main_class or options.manifest_entry:
303303
if options.manifest_entry:
304-
entries = map(lambda e: e.split(":"), options.manifest_entry)
304+
entries = [e.split(":") for e in options.manifest_entry]
305305
else:
306306
entries = []
307307
manifest_file = os.path.join(temp_dir, 'manifest')

build/apply_locales.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) 2009 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.

build/check_return_value.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 2014 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.

build/check_sdk_extras_version.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 2015 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.

build/clobber.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 2015 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.

build/compiler_version.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.

build/config/linux/pkg-config.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) 2013 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.

build/config/mac/mac_app.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 (c) 2015 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.

0 commit comments

Comments
 (0)