Skip to content

Commit

Permalink
Ensure namedtuple doesnt fail on transforms
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Sep 7, 2011
1 parent cc7acf8 commit 551d710
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sentry/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def transform(value, stack=[], context=None):
ret = 'cycle'
transform_rec = lambda o: transform(o, stack + [value], context)
if isinstance(value, (tuple, list, set, frozenset)):
ret = type(value)(transform_rec(o) for o in value)
try:
ret = type(value)(transform_rec(o) for o in value[:])
except:
ret = tuple(transform_rec(o) for o in value)
elif isinstance(value, uuid.UUID):
ret = repr(value)
elif isinstance(value, datetime.datetime):
Expand Down

0 comments on commit 551d710

Please sign in to comment.