self.assertIn("blech", err.getvalue())
+ def test_getattr_suggestions_for_same_name(self):
+ class A:
+ def __dir__(self):
+ return ['blech']
+ try:
+ A().blech
+ except AttributeError as exc:
+ with support.captured_stderr() as err:
+ sys.__excepthook__(*sys.exc_info())
+
+ self.assertNotIn("Did you mean", err.getvalue())
+
def test_attribute_error_with_failing_dict(self):
class T:
bluch = 1
if (item_str == NULL) {
return NULL;
}
+ if (PyUnicode_CompareWithASCIIString(name, item_str) == 0) {
+ continue;
+ }
// No more than 1/3 of the involved characters should need changed.
Py_ssize_t max_distance = (name_size + item_size + 3) * MOVE_COST / 6;
// Don't take matches we've already beaten.