Browse Source

Fixed #11993: fixed the the `floatformat` filter on `NaN` values in Python 2.6.3. Thanks, kklimonda.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Jacob Kaplan-Moss 15 năm trước cách đây
mục cha
commit
b30cba4e2b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      django/template/defaultfilters.py

+ 1 - 1
django/template/defaultfilters.py

@@ -162,7 +162,7 @@ def floatformat(text, arg=-1):
 
     try:
         m = int(d) - d
-    except (OverflowError, InvalidOperation):
+    except (ValueError, OverflowError, InvalidOperation):
         return input_val
 
     if not m and p < 0: