diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-23 03:18:22 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-06-23 03:18:22 +0000 |
| commit | 08aa5c585b511cfaf97ced38f2b5f7fb96492203 (patch) | |
| tree | 0f4bd1a0fffb2d60212ddcef642cf27abb3aaac5 /django/db | |
| parent | 284c6ba44b2285904f4ad4ad90d0c123b888c906 (diff) | |
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
Diffstat (limited to 'django/db')
| -rw-r--r-- | django/db/models/fields/related.py | 7 | ||||
| -rw-r--r-- | django/db/models/query.py | 7 |
2 files changed, 8 insertions, 6 deletions
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 diff --git a/django/db/models/query.py b/django/db/models/query.py index a6e702be18..8a43b1c90f 100644 --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -7,9 +7,10 @@ from django.contrib.contenttypes import generic import operator import re -# 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 # The string constant used to separate query parts LOOKUP_SEPARATOR = '__' |
