Skip to content
Prev Previous commit
Next Next commit
Fix logic error
  • Loading branch information
ShaharNaveh committed Jun 16, 2026
commit e212f160f14f8eec3a35598c9c5f921db178d0a9
8 changes: 4 additions & 4 deletions crates/vm/src/cformat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ pub(crate) fn cformat_bytes(

if num_specifiers == 0 {
if !is_mapping
|| !values_obj
&& values_obj
.downcast_ref::<tuple::PyTuple>()
.is_some_and(|e| e.is_empty())
.is_none_or(|e| !e.is_empty())
{
return Err(vm.new_type_error("not all arguments converted during bytes formatting"));
}
Expand Down Expand Up @@ -457,9 +457,9 @@ pub(crate) fn cformat_string(

if num_specifiers == 0 {
if !is_mapping
|| !values_obj
&& values_obj
.downcast_ref::<tuple::PyTuple>()
.is_some_and(|e| e.is_empty())
.is_none_or(|e| !e.is_empty())
{
return Err(vm.new_type_error("not all arguments converted during string formatting"));
}
Expand Down