diff --git a/canonicaljson.py b/canonicaljson.py index b6b1c41..89c46a1 100644 --- a/canonicaljson.py +++ b/canonicaljson.py @@ -26,7 +26,9 @@ def _default(obj): if type(obj) is frozendict: - return dict(obj) + # fishing the protected dict out of the object is a bit nasty, + # but we don't really want the overhead of copying the dict. + return obj._dict raise TypeError('Object of type %s is not JSON serializable' % obj.__class__.__name__)