diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-15 08:05:32 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-09-15 08:05:32 +0000 |
| commit | 671a8359e8a2c869264e913ace1a0e03be193d13 (patch) | |
| tree | 29345112c0dec95324de2aeb29c4efb168701433 | |
| parent | c59903101a6fbef18c18682b4fdea8d997bc7d4f (diff) | |
Fixed a small bug in strings_only handling for force_unicode().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6267 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/utils/encoding.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index 2319496538..69c3e9c28b 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -30,7 +30,7 @@ def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'): If strings_only is True, don't convert (some) non-string-like objects. """ - if strings_only and isinstance(s, (types.NoneType, int)): + if strings_only and isinstance(s, (types.NoneType, int, long)): return s if not isinstance(s, basestring,): if hasattr(s, '__unicode__'): |
