Skip to content

Commit 19f158f

Browse files
committed
Name argument fields after their Python parameters
PosixSpawnArgs.args is renamed to argv, and nt's follow_symlinks field drops a name override equal to the field name. Assisted-by: Claude:claude-opus-5-5
1 parent 9728ea4 commit 19f158f

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎crates/vm/src/stdlib/nt.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub(crate) mod module {
147147
mode: u32,
148148
#[pyarg(flatten)]
149149
dir_fd: DirFd<'static, 0>,
150-
#[pyarg(named, name = "follow_symlinks", optional)]
150+
#[pyarg(named, optional)]
151151
follow_symlinks: OptionalArg<bool>,
152152
}
153153

‎crates/vm/src/stdlib/posix.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,8 +1722,8 @@ pub mod module {
17221722
pub(super) struct PosixSpawnArgs {
17231723
#[pyarg(positional)]
17241724
path: OsPath,
1725-
#[pyarg(positional, name = "argv")]
1726-
args: PyObjectRef,
1725+
#[pyarg(positional)]
1726+
argv: PyObjectRef,
17271727
#[pyarg(positional)]
17281728
env: Option<crate::function::ArgMapping>,
17291729
#[pyarg(named, default, py_default = "()")]
@@ -1819,8 +1819,8 @@ pub mod module {
18191819
} else {
18201820
"posix_spawn"
18211821
};
1822-
if !self.args.fast_isinstance(vm.ctx.types.list_type)
1823-
&& !self.args.fast_isinstance(vm.ctx.types.tuple_type)
1822+
if !self.argv.fast_isinstance(vm.ctx.types.list_type)
1823+
&& !self.argv.fast_isinstance(vm.ctx.types.tuple_type)
18241824
{
18251825
return Err(
18261826
vm.new_type_error(format!("{function_name}: argv must be a tuple or list"))
@@ -1898,7 +1898,7 @@ pub mod module {
18981898

18991899
let setsigmask = self.setsigmask.map(collect_signals).transpose()?;
19001900

1901-
let args = vm.extract_elements_with(&self.args, |arg| {
1901+
let args = vm.extract_elements_with(&self.argv, |arg| {
19021902
CString::new(OsPath::try_from_object(vm, arg)?.into_bytes())
19031903
.map_err(|_| vm.new_value_error("path should not have nul bytes"))
19041904
})?;

0 commit comments

Comments
 (0)