Visitar URL original
_abc, _typing and update typing,test_types from 3.14.2 by youknowone · Pull Request #6797 · RustPython/RustPython · GitHub
Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Auto-format: cargo fmt --all
  • Loading branch information
github-actions[bot] committed Jan 19, 2026
commit 1b53f07b6012cd01941ebd22f36ee3477c78b5aa
14 changes: 8 additions & 6 deletions crates/vm/src/builtins/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ impl Initializer for PyNamespace {

// Validate keys are strings and set attributes
for (key, value) in dict.into_iter() {
let key_str = key.downcast_ref::<crate::builtins::PyStr>().ok_or_else(|| {
vm.new_type_error(format!(
"keywords must be strings, not '{}'",
key.class().name()
))
})?;
let key_str = key
.downcast_ref::<crate::builtins::PyStr>()
.ok_or_else(|| {
vm.new_type_error(format!(
"keywords must be strings, not '{}'",
key.class().name()
))
})?;
zelf.as_object().set_attr(key_str, value, vm)?;
}
}
Expand Down
Loading