Django

Code

Changeset 5388

Show
Ignore:
Timestamp:
05/31/07 04:03:29 (1 year ago)
Author:
mtredinnick
Message:

unicode: Changed handling of None in smart_unicode/force_unicode. There is no
case when converting it to a unicode string seems useful, so keep it as None.
Fixed #4435.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/django/utils/encoding.py

    r5322 r5388  
    2828    strings, rather than kept as lazy objects. 
    2929    """ 
     30    if s is None: 
     31        return s 
    3032    if not isinstance(s, basestring,): 
    3133        if hasattr(s, '__unicode__'): 
     
    7375    # characters that are not explicitly excluded by the list at the end of 
    7476    # section 3.1 of RFC 3987. 
     77    if iri is None: 
     78        return iri 
    7579    return urllib.quote(smart_str(iri), safe='/#%[]=:;$&()+,!?') 
    7680