Hi Stefan, On 08/25/2017 12:57 PM, Stefan Hajnoczi wrote:
Many scripts can benefit from the standard library argparse module, which has improvements over the older optparse module. Unfortunately argparse was only shipped in Python 2.7 so we need a fallback for Python 2.6.
I probably missed some discussion about it, but what are the reasons to stay 2.6 compatible?
Python 2.6 support ended during October 2013, 4 years ago... [1] Why don't kill it, start deprecating 2.7 which support will end in less than 3 years from now [2], and move efforts to version 3...?
Apparently we expect a C compiler compatible with GCC >= 4.1 which was released on 2006, before Python 2.5 :S
Then QEMU_BUILD_BUG_ON() try to use C11 feature... [1] https://www.python.org/dev/peps/pep-0361/ and https://mail.python.org/pipermail/python-dev/2013-September/128287.html [2] https://www.python.org/dev/peps/pep-0373/ and https://pythonclock.org/ Regards, Phil.
This patch series adds a copy of argparse.py and updates scripts as necessary to import it. Stefan Hajnoczi (3): scripts: add argparse module for Python 2.6 compatibility docker.py: Python 2.6 argparse compatibility tests: migration/guestperf Python 2.6 argparse compatibility COPYING.PYTHON | 270 ++++ scripts/argparse.py | 2406 ++++++++++++++++++++++++++++++++++++ tests/docker/docker.py | 4 +- tests/migration/guestperf/shell.py | 8 +- 4 files changed, 2684 insertions(+), 4 deletions(-) create mode 100644 COPYING.PYTHON create mode 100644 scripts/argparse.py