Skip to content

Commit c8a9fc0

Browse files
committed
Allow dummy faulthandler functions to accept kwargs
1 parent 8621c93 commit c8a9fc0

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

vm/src/stdlib/faulthandler.rs

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,31 @@ fn dump_traceback(_file: OptionalArg<i64>, _all_threads: OptionalArg<bool>, vm:
2020
}
2121
}
2222

23-
fn enable(_file: OptionalArg<i64>, _all_threads: OptionalArg<bool>) {
23+
#[derive(FromArgs)]
24+
struct EnableArgs {
25+
#[pyarg(positional_or_keyword, default = "None")]
26+
file: Option<i64>,
27+
#[pyarg(positional_or_keyword, default = "true")]
28+
all_threads: bool,
29+
}
30+
31+
fn enable(_args: EnableArgs) {
2432
// TODO
2533
}
2634

27-
fn register(
28-
_signum: i64,
29-
_file: OptionalArg<i64>,
30-
_all_threads: OptionalArg<bool>,
31-
_chain: OptionalArg<bool>,
32-
) {
35+
#[derive(FromArgs)]
36+
struct RegisterArgs {
37+
#[pyarg(positional_only)]
38+
signum: i64,
39+
#[pyarg(positional_or_keyword, default = "None")]
40+
file: Option<i64>,
41+
#[pyarg(positional_or_keyword, default = "true")]
42+
all_threads: bool,
43+
#[pyarg(positional_or_keyword, default = "false")]
44+
chain: bool,
45+
}
46+
47+
fn register(_args: RegisterArgs) {
3348
// TODO
3449
}
3550

0 commit comments

Comments
 (0)