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/db/models/fields/related.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'django/db/models/fields') diff --git a/django/db/models/fields/related.py b/django/db/models/fields/related.py index 0739d0461a..e514b3f854 100644 --- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ -10,9 +10,10 @@ from django import oldforms from django import newforms as forms from django.dispatch import dispatcher -# For Python 2.3 -if not hasattr(__builtins__, 'set'): - from sets import Set as set +try: + set +except NameError: + from sets import Set as set # Python 2.3 fallback # Values for Relation.edit_inline. TABULAR, STACKED = 1, 2 -- cgit v1.3