From a19ea41a80066e4e744f766c8a410a8c6ac88ce9 Mon Sep 17 00:00:00 2001 From: Dmitry Meyer Date: Mon, 15 Apr 2024 10:14:06 +0000 Subject: [PATCH] fix: fix mk help on Python 3.10+ --- src/luamb/_luamb.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/luamb/_luamb.py b/src/luamb/_luamb.py index f2c7262..783bf93 100644 --- a/src/luamb/_luamb.py +++ b/src/luamb/_luamb.py @@ -252,9 +252,13 @@ def cmd_mk(self, argv): if args.help or (not args.env_name and not args.list_versions): output = self._call_hererocks(['--help'], capture_output=True) - hererocks_help = output.partition("optional arguments:\n")[2] + if sys.version_info >= (3, 10): + options_heading = "options:\n" + else: + options_heading = "optional arguments:\n" + hererocks_help = output.partition(options_heading)[2] parser.print_help() - print('\nhererocks arguments:') + print('\nhererocks options:') print(hererocks_help) return