From 99ede69bbb560a739e68f6481037ba6dfc133f54 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sun, 23 Aug 2020 21:40:26 +0800 Subject: [PATCH 1/3] port tools in cpython from python2 to python3 --- Lib/encodings/rot_13.py | 2 +- Mac/BuildScript/build-installer.py | 2 +- Modules/_sha3/cleanup.py | 2 +- Objects/typeslots.py | 2 +- Parser/asdl_c.py | 2 +- Python/makeopcodetargets.py | 2 +- Tools/gdb/libpython.py | 2 +- Tools/pynche/pynche | 2 +- Tools/scripts/smelly.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Lib/encodings/rot_13.py b/Lib/encodings/rot_13.py index 5627bfbc69cbbc8..334624f91ff2d09 100755 --- a/Lib/encodings/rot_13.py +++ b/Lib/encodings/rot_13.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ Python Character Mapping Codec for ROT13. This codec de/encodes from str to str. diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py index a58b922ce30b836..3d68f40263e6084 100755 --- a/Mac/BuildScript/build-installer.py +++ b/Mac/BuildScript/build-installer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ This script is used to build "official" universal installers on macOS. diff --git a/Modules/_sha3/cleanup.py b/Modules/_sha3/cleanup.py index 4f53681b49e67bc..1d81b83c027a02a 100755 --- a/Modules/_sha3/cleanup.py +++ b/Modules/_sha3/cleanup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (C) 2012 Christian Heimes (christian@python.org) # Licensed to PSF under a Contributor Agreement. # diff --git a/Objects/typeslots.py b/Objects/typeslots.py index 9b6d4adbc7533b5..2b26dca965a01aa 100755 --- a/Objects/typeslots.py +++ b/Objects/typeslots.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 # Usage: typeslots.py < Include/typeslots.h typeslots.inc import sys, re diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py index 6fe44b99f793bb4..7f1f51b1a452ed7 100755 --- a/Parser/asdl_c.py +++ b/Parser/asdl_c.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """Generate C code from an ASDL description.""" import os diff --git a/Python/makeopcodetargets.py b/Python/makeopcodetargets.py index 023c9e6c9f1adc1..632c758e1b2ae58 100755 --- a/Python/makeopcodetargets.py +++ b/Python/makeopcodetargets.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """Generate C code for the jump table of the threaded code interpreter (for compilers supporting computed gotos or "labels-as-values", such as gcc). """ diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py index 33bf5ac821fffc2..f3814d517b3d20f 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python3 ''' From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb to be extended with Python code e.g. for library-specific data visualizations, diff --git a/Tools/pynche/pynche b/Tools/pynche/pynche index 64bf70335db2f5b..19bf2980806381d 100755 --- a/Tools/pynche/pynche +++ b/Tools/pynche/pynche @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 """Run this file under Unix, or when debugging under Windows. Run the file pynche.pyw under Windows to inhibit the console window. diff --git a/Tools/scripts/smelly.py b/Tools/scripts/smelly.py index 43d091654d2dc84..6a17ed979202e46 100755 --- a/Tools/scripts/smelly.py +++ b/Tools/scripts/smelly.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Script checking that all symbols exported by libpython start with Py or _Py import subprocess From a0b989b93466a551a1389fdf064fde9f8802a0ea Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Tue, 25 Aug 2020 00:02:08 +0800 Subject: [PATCH 2/3] update pynche.pynche --- Tools/pynche/pynche | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/pynche/pynche b/Tools/pynche/pynche index 19bf2980806381d..1024f0ff6bb3edc 100755 --- a/Tools/pynche/pynche +++ b/Tools/pynche/pynche @@ -3,5 +3,5 @@ """Run this file under Unix, or when debugging under Windows. Run the file pynche.pyw under Windows to inhibit the console window. """ -import Main +from . import Main Main.main() From f18dddf7a141b0b2b9248edb7259a0c054fe429f Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Fri, 28 Aug 2020 20:47:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?revert=20pynche=20as=20Herv=C3=A9=20Beraud'?= =?UTF-8?q?s=20comment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tools/pynche/pynche | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/pynche/pynche b/Tools/pynche/pynche index 1024f0ff6bb3edc..19bf2980806381d 100755 --- a/Tools/pynche/pynche +++ b/Tools/pynche/pynche @@ -3,5 +3,5 @@ """Run this file under Unix, or when debugging under Windows. Run the file pynche.pyw under Windows to inhibit the console window. """ -from . import Main +import Main Main.main()