martine/ninja — pull request #870 by lucasart (2014-11-30 11:08:55+00:00)
Title: Python 3 compatibility

Make configure.py a bit more future-proof:
- use argparse instead of optparse, because optparse is deprecated since Python 2.7.
- syntax fix for Python 3: replace `except X, T` by `except X as T`.

configure.py now runs with Python 2 and Python 3. I ran the following tests:
- `./configure.py` with Python 2
- `./configure.py` with Python 3
- `./configure.py` with Python 2 on master branch
- in all 3 cases `build.ninja` is the same.

Note that argparse allows some code simplification too:
- no need to enumerate the choices in 'help' (automatic).
- no need to check for unparsed arguments (automatic).