Python shebang modernisation for python3

PEP-394 recommends specifying python2 or python3 in shebangs unless the
script is known to only run in an activated virtual environment.

PEP-394 also says distributors may not provide the python command.
Newer versions of Ubuntu, at least, no longer provide python unless the
python-is-python3 package is explicitly installed.

Removed some shebangs from testcases (the test-suite does not need them).
This commit is contained in:
William S Fulton 2024-09-21 21:40:21 +01:00
parent b208d4b330
commit baa725e5ff
13 changed files with 9 additions and 14 deletions

View File

@ -22,7 +22,7 @@ HTMLDOC_OPTIONS = "--book --toclevels 4 --no-numbered --toctitle \"Table of Cont
all: maketoc check generate all: maketoc check generate
maketoc: maketoc:
python maketoc.py python3 maketoc.py
# Use this to regenerate CCache.html should this ever be needed # Use this to regenerate CCache.html should this ever be needed
CCache.html: ../../CCache/ccache.yo CCache.html: ../../CCache/ccache.yo
@ -48,7 +48,7 @@ generate: SWIGDocumentation.html
SWIGDocumentation.html: swightml.book SWIGDocumentation.html: swightml.book
htmldoc --batch swightml.book || true htmldoc --batch swightml.book || true
python fixstyle.py SWIGDocumentation.html python3 fixstyle.py SWIGDocumentation.html
swightml.book: chapters Sections.html swightml.book: chapters Sections.html
echo "#HTMLDOC 1.8.24" > swightml.book echo "#HTMLDOC 1.8.24" > swightml.book

View File

@ -319,7 +319,7 @@ Here is a sample <tt>setup.py</tt> file for the above example:
<div class="code"> <div class="code">
<pre> <pre>
#!/usr/bin/env python #!/usr/bin/env python3
""" """
setup.py file for SWIG example setup.py file for SWIG example

View File

@ -1,4 +1,4 @@
#!/usr/bin/python #!/usr/bin/python3
# Replace the inline htmldoc stylesheet with the SWIG stylesheet # Replace the inline htmldoc stylesheet with the SWIG stylesheet

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
############################################################################### ###############################################################################
# Takes a chapter as input and adds internal links and numbering to all # Takes a chapter as input and adds internal links and numbering to all

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import sys import sys
import os import os

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
var operbool = require("operbool"); var operbool = require("operbool");
const b = new operbool.Test(); const b = new operbool.Test();
if (b.operator_bool()) { if (b.operator_bool()) {

View File

@ -1,4 +1,3 @@
#!/usr/bin/evn python
from cpp_static import * from cpp_static import *

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
import keyword_rename_c import keyword_rename_c
keyword_rename_c._in(1) keyword_rename_c._in(1)
keyword_rename_c._except(1) keyword_rename_c._except(1)

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
import keyword_rename import keyword_rename
keyword_rename._in(1) keyword_rename._in(1)
keyword_rename._in(_except=1) keyword_rename._in(_except=1)

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python
import operbool import operbool
if operbool.Test(): if operbool.Test():
raise RuntimeError("operbool failed") raise RuntimeError("operbool failed")

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
import os import os
import subprocess import subprocess

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python2
""" """
From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py, From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py,
since they are inappropriate and discouraged in Python documentation since they are inappropriate and discouraged in Python documentation

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python3
def get_cflags(language, std, compiler): def get_cflags(language, std, compiler):
if std == None or len(std) == 0: if std == None or len(std) == 0: