Skip to content

Commit 446abb5

Browse files
committed
[lldb/crashlog] Fix python version requirement issue
In 21a597c, we fixed a module loading issue by using the new `argparse.BooleanOptionalAction`. However, this is only available starting python 3.9 and causes test failures on bots that don't fulfill this requirement. To address that, this patch replaces the use of `BooleanOptionalAction` by a pair of 2 opposite `store` actions pointing to the same destination variable. Differential Revision: https://reviews.llvm.org/D158452 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent a69340d commit 446abb5

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lldb/examples/python/crashlog.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,14 +1603,29 @@ def CreateSymbolicateCrashLogOptions(
16031603
help="pause for NSEC seconds for debugger",
16041604
default=0,
16051605
)
1606+
# NOTE: Requires python 3.9
1607+
# arg_parser.add_argument(
1608+
# "--crashed-only",
1609+
# "-c",
1610+
# action=argparse.BooleanOptionalAction,
1611+
# dest="crashed_only",
1612+
# help="only symbolicate the crashed thread",
1613+
# default=True,
1614+
# )
16061615
arg_parser.add_argument(
16071616
"--crashed-only",
16081617
"-c",
1609-
action=argparse.BooleanOptionalAction,
1618+
action="store_true",
16101619
dest="crashed_only",
16111620
help="only symbolicate the crashed thread",
16121621
default=True,
16131622
)
1623+
arg_parser.add_argument(
1624+
"--no-crashed-only",
1625+
action="store_false",
1626+
dest="crashed_only",
1627+
help="do not symbolicate the crashed thread",
1628+
)
16141629
arg_parser.add_argument(
16151630
"--disasm-depth",
16161631
"-d",

0 commit comments

Comments
 (0)