Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ jobs:

- name: Check whats_left is not broken
shell: bash
run: python -I scripts/whats_left.py --rustpython target/release/rustpython
run: python -I scripts/whats_left.py --signature --rustpython target/release/rustpython

clippy:
# Named after the matrix entry rather than left to be named for it: a
Expand Down
28 changes: 14 additions & 14 deletions crates/vm/src/stdlib/_lsprof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mod _lsprof {
},
common::{lock::PyMutex, wtf8::Wtf8Buf},
convert::ToPyObject,
function::{FuncArgs, OptionalArg, PyMethodDef},
function::{ArgIntoBool, FuncArgs, OptionalArg, PyMethodDef},
object::{Traverse, TraverseFn},
stdlib::sys::monitoring::MonitoringEvent,
types::{Constructor, Initializer, PyStructSequence},
Expand Down Expand Up @@ -167,22 +167,22 @@ mod _lsprof {

#[derive(FromArgs)]
struct InitArgs {
#[pyarg(any, optional)]
#[pyarg(any, optional, py_default = "None")]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check you really need this

timer: OptionalArg<PyObjectRef>,
#[pyarg(any, default = 0.0)]
timeunit: f64,
#[pyarg(any, default = true)]
subcalls: bool,
#[pyarg(any, default = true)]
builtins: bool,
#[pyarg(any, default = ArgIntoBool::TRUE)]
subcalls: ArgIntoBool,
#[pyarg(any, default = ArgIntoBool::TRUE)]
builtins: ArgIntoBool,
}

#[derive(FromArgs)]
struct EnableArgs {
#[pyarg(any, default = true)]
subcalls: bool,
#[pyarg(any, default = true)]
builtins: bool,
#[pyarg(any, default = ArgIntoBool::TRUE)]
subcalls: ArgIntoBool,
#[pyarg(any, default = ArgIntoBool::TRUE)]
builtins: ArgIntoBool,
}

impl Constructor for Profiler {
Expand All @@ -204,8 +204,8 @@ mod _lsprof {
let old_timer = {
let mut state = zelf.state.lock();
state.unit = args.timeunit;
state.subcalls = args.subcalls;
state.builtins = args.builtins;
state.subcalls = args.subcalls.into_bool();
state.builtins = args.builtins.into_bool();
core::mem::replace(&mut state.timer, args.timer.into_option())
};
drop(old_timer);
Expand Down Expand Up @@ -545,8 +545,8 @@ mod _lsprof {
zelf.with_operation(vm, || {
{
let mut state = zelf.state.lock();
state.subcalls = args.subcalls;
state.builtins = args.builtins;
state.subcalls = args.subcalls.into_bool();
state.builtins = args.builtins.into_bool();
}
let monitoring = vm.sys_module.get_attr("monitoring", vm)?;
vm.call_method(&monitoring, "use_tool_id", (TOOL_ID, "cProfile"))?;
Expand Down
Loading