Skip to content

Commit

Permalink
Changed encoding.shorten to use serializers's transform
Browse files Browse the repository at this point in the history
In order to get rid of the spam of deprecationwarnings.
  • Loading branch information
joar committed Sep 7, 2012
1 parent 0541383 commit 8bc5054
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion raven/utils/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def force_unicode(s, encoding='utf-8', errors='strict'):

def transform(value):
from raven.utils.serializer import transform

warnings.warn('You should switch to raven.utils.serializer.transform', DeprecationWarning)

return transform(value)
Expand All @@ -82,6 +81,8 @@ def to_string(value):


def shorten(var, list_length=50, string_length=200):
from raven.utils.serializer import transform

var = transform(var)
if isinstance(var, basestring) and len(var) > string_length:
var = var[:string_length] + '...'
Expand Down

0 comments on commit 8bc5054

Please sign in to comment.