Merge pull request #2466 from e-kwsm/python2

refactor!: drop python2
This commit is contained in:
van Hauser
2025-06-09 10:41:14 +02:00
committed by GitHub
12 changed files with 17 additions and 29 deletions

View File

@ -255,17 +255,6 @@ ifeq "$(PYTHON_INCLUDE)" ""
endif
endif
# Old Ubuntu and others dont have python/python2-config so we hardcode 2.7
ifeq "$(PYTHON_INCLUDE)" ""
ifneq "$(shell command -v python2.7 2>/dev/null)" ""
ifneq "$(shell command -v python2.7-config 2>/dev/null)" ""
PYTHON_INCLUDE := $(shell python2.7-config --includes)
PYTHON_LIB := $(shell python2.7-config --ldflags)
PYTHON_VERSION := $(strip $(shell python2.7 --version 2>&1))
endif
endif
endif
ifdef SOURCE_DATE_EPOCH
BUILD_DATE ?= $(shell date -u -d "@$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u -r "$(SOURCE_DATE_EPOCH)" "+%Y-%m-%d" 2>/dev/null || date -u "+%Y-%m-%d")
else

View File

@ -3,8 +3,7 @@
These are example and helper files for the custom mutator feature.
See [docs/custom_mutators.md](../../docs/custom_mutators.md) for more information
Note that if you compile with python3.7 you must use python3 scripts, and if
you use python2.7 to compile python2 scripts!
Note that if you compile with python3.7 you must use python3 scripts.
simple_example.c - most simplest example. generates a random sized buffer
filled with 'A'

View File

@ -56,7 +56,7 @@ if [ ! -f "../../src/afl-performance.o" ]; then
fi
PYTHONBIN=`command -v python3 || command -v python || command -v python2 || echo python3`
PYTHONBIN=`command -v python3 || command -v python || echo python3`
MAKECMD=make
TARCMD=tar

View File

@ -52,7 +52,7 @@ if [ ! -f "../../config.h" ]; then
fi
PYTHONBIN=`command -v python3 || command -v python || command -v python2 || echo python3`
PYTHONBIN=`command -v python3 || command -v python || echo python3`
MAKECMD=make
TARCMD=tar

View File

@ -10,7 +10,7 @@ test -s ../unicorn_mode/unicornafl/build/libunicornafl.a && {
export AFL_DEBUG_CHILD=1
# some python version should be available now
PYTHONS="`command -v python3` `command -v python` `command -v python2`"
PYTHONS="`command -v python3` `command -v python`"
EASY_INSTALL_FOUND=0
for PYTHON in $PYTHONS ; do

View File

@ -65,7 +65,7 @@ if [ ! -f "../afl-showmap" ]; then
fi
PYTHONBIN=`command -v python3 || command -v python || command -v python2 || echo python3`
PYTHONBIN=`command -v python3 || command -v python || echo python3`
MAKECMD=make
TARCMD=tar
@ -116,7 +116,7 @@ for i in $PYTHONBIN automake autoconf git $MAKECMD $TARCMD; do
done
# some python version should be available now
PYTHONS="`command -v python3` `command -v python` `command -v python2`"
PYTHONS="`command -v python3` `command -v python`"
PIP_FOUND=0
for PYTHON in $PYTHONS ; do

View File

@ -33,7 +33,7 @@ def ensure_dir(dir):
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python2 thisfile.py outdir str.txt"
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python3 thisfile.py outdir str.txt"
)
)

View File

@ -17,7 +17,7 @@ from binascii import unhexlify
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file to analysis and output folder to save corpdirus for constants in the overall project ------- Example usage : python2 thisfile.py outdir o.txt"
"Helper - Specify input file to analysis and output folder to save corpdirus for constants in the overall project ------- Example usage : python3 thisfile.py outdir o.txt"
)
)
parser.add_argument(
@ -25,7 +25,7 @@ def parse_args():
)
parser.add_argument(
"infile",
help="Specify file output of codeql analysis - ex. ooo-hex.txt, analysis take place on this file, example : python2 thisfile.py outdir out.txt",
help="Specify file output of codeql analysis - ex. ooo-hex.txt, analysis take place on this file, example : python3 thisfile.py outdir out.txt",
)
return parser.parse_args()

View File

@ -25,7 +25,7 @@ def ensure_dir(dir):
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python2 thisfile.py outdir str.txt"
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python3 thisfile.py outdir str.txt"
)
)
parser.add_argument(
@ -33,7 +33,7 @@ def parse_args():
)
parser.add_argument(
"infile",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python2 thisfile.py outdir strings.txt",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python3 thisfile.py outdir strings.txt",
)
return parser.parse_args()

View File

@ -25,7 +25,7 @@ def ensure_dir(dir):
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python2 thisfile.py outdir str.txt"
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python3 thisfile.py outdir str.txt"
)
)
parser.add_argument(
@ -33,7 +33,7 @@ def parse_args():
)
parser.add_argument(
"infile",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python2 thisfile.py outdir strings.txt",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python3 thisfile.py outdir strings.txt",
)
return parser.parse_args()

View File

@ -25,7 +25,7 @@ def ensure_dir(dir):
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python2 thisfile.py outdir str.txt"
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python3 thisfile.py outdir str.txt"
)
)
parser.add_argument(
@ -33,7 +33,7 @@ def parse_args():
)
parser.add_argument(
"infile",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python2 thisfile.py outdir strings.txt",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python3 thisfile.py outdir strings.txt",
)
return parser.parse_args()

View File

@ -25,7 +25,7 @@ def ensure_dir(dir):
def parse_args():
parser = argparse.ArgumentParser(
description=(
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python2 thisfile.py outdir str.txt"
"Helper - Specify input file analysis and output folder to save corpus for strings in the overall project --------------------------------------------------------------------------- Example usage : python3 thisfile.py outdir str.txt"
)
)
parser.add_argument(
@ -33,7 +33,7 @@ def parse_args():
)
parser.add_argument(
"infile",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python2 thisfile.py outdir strings.txt",
help="Specify file output of codeql analysis - ex. ooo-atr.txt, analysis take place on this file, example : python3 thisfile.py outdir strings.txt",
)
return parser.parse_args()