Skip to content

Commit

Permalink
Don't dup and freeze already frozen kesy
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Gaynor committed Apr 8, 2013
1 parent ec8fee4 commit 507d749
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion topaz/objects/hashobject.py
Expand Up @@ -79,7 +79,9 @@ def method_fetch(self, space, w_key, w_value=None, block=None):
@classdef.method("[]=")
@check_frozen()
def method_subscript_assign(self, space, w_key, w_value):
if space.is_kind_of(w_key, space.w_string):
if (space.is_kind_of(w_key, space.w_string) and
not space.is_true(space.send(w_key, space.newsymbol("frozen?")))):

w_key = space.send(w_key, space.newsymbol("dup"))
w_key = space.send(w_key, space.newsymbol("freeze"))
self.contents[w_key] = w_value
Expand Down

0 comments on commit 507d749

Please sign in to comment.