From 08aa5c585b511cfaf97ced38f2b5f7fb96492203 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 23 Jun 2007 03:18:22 +0000 Subject: Fixed #4607 -- Tweaked checks for features missing in Python 2.3 to not assume things Python does not guarantee. Patch from SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5514 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/template/defaulttags.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'django/template') diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py index 0e26af0cac..66443fc3b3 100644 --- a/django/template/defaulttags.py +++ b/django/template/defaulttags.py @@ -8,8 +8,10 @@ from django.utils.itercompat import groupby import sys import re -if not hasattr(__builtins__, 'reversed'): - # For Python 2.3. +try: + reversed +except NameError: + # Python 2.3 fallback. # From http://www.python.org/doc/current/tut/node11.html def reversed(data): for index in xrange(len(data)-1, -1, -1): -- cgit v1.3