Ticket #6184: 6184.diff

File 6184.diff, 515 bytes (added by Chris Chamberlin <dja@…>, 17 years ago)
  • django/utils/encoding.py

     
    6666
    6767    If strings_only is True, don't convert (some) non-string-like objects.
    6868    """
    69     if strings_only and isinstance(s, (types.NoneType, int)):
     69    if strings_only and not isinstance(s, basestring):
    7070        return s
    7171    if isinstance(s, Promise):
    7272        return unicode(s).encode(encoding, errors)
Back to Top