Remove unnecessary keyword argument checks

This commit is contained in:
Dan 2025-11-19 19:02:46 -05:00
parent 74266724b4
commit df296fbac1
1 changed files with 0 additions and 12 deletions

View File

@ -73,18 +73,6 @@ pub(crate) fn check_os_pathlib_single_arg_calls(
return; return;
} }
// If there are keyword arguments other than `dir_fd` or the main argument, skip
// We need to allow the main argument to be passed as a keyword, and `dir_fd=None`
// Note: `dir_fd` non-default value checking is done by the caller before invoking this helper
let allowed_keywords = if has_keyword_arg {
&[fn_argument, "dir_fd"][..]
} else {
&["dir_fd"][..]
};
if has_unknown_keywords_or_starred_expr(&call.arguments, allowed_keywords) {
return;
}
let Some(arg) = call.arguments.find_argument_value(fn_argument, 0) else { let Some(arg) = call.arguments.find_argument_value(fn_argument, 0) else {
return; return;
}; };