Skip to content

Commit

Permalink
Remove the usage of deprecated function in Django. Also simplify the …
Browse files Browse the repository at this point in the history
…fallback code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
alex committed Oct 14, 2011
1 parent d1e7409 commit 6c91521
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion django/contrib/auth/forms.py
@@ -1,7 +1,6 @@
from django import forms from django import forms
from django.template import loader from django.template import loader
from django.utils.http import int_to_base36 from django.utils.http import int_to_base36
from django.utils.itercompat import any
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _


from django.contrib.auth.models import User from django.contrib.auth.models import User
Expand Down
11 changes: 3 additions & 8 deletions django/utils/itercompat.py
Expand Up @@ -4,6 +4,7 @@
these implementations if necessary. these implementations if necessary.
""" """


import __builtin__
import itertools import itertools
import warnings import warnings


Expand Down Expand Up @@ -36,15 +37,9 @@ def is_iterable(x):
def all(iterable): def all(iterable):
warnings.warn("django.utils.itercompat.all is deprecated; use the native version instead", warnings.warn("django.utils.itercompat.all is deprecated; use the native version instead",
PendingDeprecationWarning) PendingDeprecationWarning)
for item in iterable: return __builtin__.all(iterable)
if not item:
return False
return True


def any(iterable): def any(iterable):
warnings.warn("django.utils.itercompat.any is deprecated; use the native version instead", warnings.warn("django.utils.itercompat.any is deprecated; use the native version instead",
PendingDeprecationWarning) PendingDeprecationWarning)
for item in iterable: return __builtin__.any(iterable)
if item:
return True
return False
2 changes: 1 addition & 1 deletion tests/regressiontests/admin_views/tests.py
Expand Up @@ -135,7 +135,7 @@ def testPopupAddPost(self):
'date_1': u'14:55:39', 'date_1': u'14:55:39',
} }
response = self.client.post('/test_admin/%s/admin_views/article/add/' % self.urlbit, post_data) response = self.client.post('/test_admin/%s/admin_views/article/add/' % self.urlbit, post_data)
self.failUnlessEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertContains(response, 'dismissAddAnotherPopup') self.assertContains(response, 'dismissAddAnotherPopup')
self.assertContains(response, 'title with a new\u000Aline') self.assertContains(response, 'title with a new\u000Aline')


Expand Down

0 comments on commit 6c91521

Please sign in to comment.