diff options
| author | Damien George | 2016-09-28 11:06:18 +1000 |
|---|---|---|
| committer | Damien George | 2016-09-28 11:06:18 +1000 |
| commit | 2c7716fed03049a72d68096908c334e5c9bb1680 (patch) | |
| tree | 6d2020d3a0921af73d670320d85a65132d431542 | |
| parent | dd4135aeaf0669b8c61daf2a1f810eec12bf1336 (diff) | |
py/objset: Ensure that use of frozenset.update raises an exception.
| -rw-r--r-- | py/objset.c | 1 | ||||
| -rw-r--r-- | tests/basics/frozenset_add.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/py/objset.c b/py/objset.c index 042549900..6b6f95f9b 100644 --- a/py/objset.c +++ b/py/objset.c @@ -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]); } diff --git a/tests/basics/frozenset_add.py b/tests/basics/frozenset_add.py index 50615775b..415a8c2e1 100644 --- a/tests/basics/frozenset_add.py +++ b/tests/basics/frozenset_add.py @@ -10,3 +10,8 @@ try: print(s.add(5)) except AttributeError: print("AttributeError") + +try: + print(s.update([5])) +except AttributeError: + print("AttributeError") |
