Skip to content
Open
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
3 changes: 0 additions & 3 deletions Lib/test/datetimetester.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd extract this changes to a separate PR as the problematic change seems to be with the modifications of the error message

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I'll clean this up later today / tomorrow.

Original file line number Diff line number Diff line change
Expand Up @@ -3011,7 +3011,6 @@ def test_more_strftime(self):
self.assertEqual(t.strftime("%z"), "-0200" + z)
self.assertEqual(t.strftime("%:z"), "-02:00:" + z)

@unittest.skip("TODO: RUSTPYTHON")
def test_strftime_special(self):
t = self.theclass(2004, 12, 31, 6, 22, 33, 47)
s1 = t.strftime('%c')
Expand Down Expand Up @@ -3879,7 +3878,6 @@ def test_strftime(self):
# gh-85432: The parameter was named "fmt" in the pure-Python impl.
t.strftime(format="%f")

@unittest.skip("TODO: RUSTPYTHON")
def test_strftime_special(self):
t = self.theclass(1, 2, 3, 4)
s1 = t.strftime('%I%p%Z')
Expand Down Expand Up @@ -4360,7 +4358,6 @@ def test_empty(self):
self.assertEqual(t.microsecond, 0)
self.assertIsNone(t.tzinfo)

@unittest.skip("TODO: RUSTPYTHON")
def test_zones(self):
est = FixedOffset(-300, "EST", 1)
utc = FixedOffset(0, "UTC", -2)
Expand Down
1 change: 0 additions & 1 deletion Lib/test/test_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __getitem__(self, n):
return [self.el][n]

class TestContains(unittest.TestCase):
@unittest.expectedFailure # TODO: RUSTPYTHON; Wrong error message
def test_common_tests(self):
a = base_set(1)
b = myset(1)
Expand Down
8 changes: 7 additions & 1 deletion crates/stdlib/src/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,13 @@ mod _csv {
}

let row = ArgIterable::try_from_object(vm, row.clone()).map_err(|_e| {
new_csv_error(vm, format!("\'{}\' object is not iterable", row.class()))
new_csv_error(
vm,
format!(
"argument of type \'{}\' is not a container or iterable",
row.class()
),
)
})?;
let mut first_flag = true;
for field in row.iter(vm)? {
Expand Down
5 changes: 4 additions & 1 deletion crates/vm/src/function/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ where
let cls = obj.class();
let iter_fn = cls.slots.iter.load();
if iter_fn.is_none() && !cls.has_attr(identifier!(vm, __getitem__)) {
return Err(vm.new_type_error(format!("'{}' object is not iterable", cls.name())));
return Err(vm.new_type_error(format!(
"argument of type \'{}\' is not a container or iterable",
cls.name()
)));
}
Ok(Self {
iterable: obj,
Expand Down
2 changes: 1 addition & 1 deletion crates/vm/src/protocol/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl TryFromObject for PyIter<PyObjectRef> {
Ok(Self(seq_iter.into_pyobject(vm)))
} else {
Err(vm.new_type_error(format!(
"'{}' object is not iterable",
"argument of type \'{}\' is not a container or iterable",
iter_target.class().name()
)))
}
Expand Down
Loading