py/objset: Ensure that use of frozenset.update raises an exception.

pull/2461/head
Damien George 2016-09-28 11:06:18 +10:00
rodzic dd4135aeaf
commit 2c7716fed0
2 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -435,6 +435,7 @@ STATIC void set_update_int(mp_obj_set_t *self, mp_obj_t other_in) {
}
STATIC mp_obj_t set_update(size_t n_args, const mp_obj_t *args) {
check_set(args[0]);
for (mp_uint_t i = 1; i < n_args; i++) {
set_update_int(MP_OBJ_TO_PTR(args[0]), args[i]);
}

Wyświetl plik

@ -10,3 +10,8 @@ try:
print(s.add(5))
except AttributeError:
print("AttributeError")
try:
print(s.update([5]))
except AttributeError:
print("AttributeError")