Skip to content
Permalink
Browse files

Don't dup and freeze already frozen kesy

  • Loading branch information
Alex Gaynor
Alex Gaynor committed Apr 8, 2013
1 parent ec8fee4 commit 507d7492bd76d4db3bed9f7b98fbacd3b36c3482
Showing with 3 additions and 1 deletion.
  1. +3 −1 topaz/objects/hashobject.py
@@ -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

0 comments on commit 507d749

Please sign in to comment.
You can’t perform that action at this time.