Mesa (master): bin/khronos-update: add workaround for python bug 9625

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 24 12:25:23 UTC 2020


Module: Mesa
Branch: master
Commit: 859687313be7d90433f631a7ef35af9791350a9f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=859687313be7d90433f631a7ef35af9791350a9f

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Fri Jul 24 14:20:44 2020 +0200

bin/khronos-update: add workaround for python bug 9625

The bug causes `choices` to break `nargs='*'`.

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6057>

---

 bin/khronos-update.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bin/khronos-update.py b/bin/khronos-update.py
index 6f93c71f831..cc82a07b08c 100755
--- a/bin/khronos-update.py
+++ b/bin/khronos-update.py
@@ -191,7 +191,10 @@ if __name__ == '__main__':
 
     parser = argparse.ArgumentParser()
     parser.add_argument('apis', nargs='*',
-                        choices=[group['api'] for group in SOURCES],
+                        # the `[[]]` here is a workaround for python bug 9625
+                        # where having `choices` breaks `nargs='*'`:
+                        # https://bugs.python.org/issue9625
+                        choices=[group['api'] for group in SOURCES] + [[]],
                         help='Only update the APIs specified.')
     args = parser.parse_args()
 



More information about the mesa-commit mailing list