[Checkins] SVN: zope.app.publication/trunk/ Use builtin set instead of deprecated in python2.6 sets.Set.

Dan Korostelev nadako at gmail.com
Wed Mar 4 19:49:16 EST 2009


Log message for revision 97506:
  Use builtin set instead of deprecated in python2.6 sets.Set.

Changed:
  U   zope.app.publication/trunk/CHANGES.txt
  U   zope.app.publication/trunk/src/zope/app/publication/requestpublicationregistry.py

-=-
Modified: zope.app.publication/trunk/CHANGES.txt
===================================================================
--- zope.app.publication/trunk/CHANGES.txt	2009-03-05 00:47:39 UTC (rev 97505)
+++ zope.app.publication/trunk/CHANGES.txt	2009-03-05 00:49:16 UTC (rev 97506)
@@ -7,6 +7,9 @@
 
 - Remove deprecated code.
 
+- Use built-in set class instead of the deprecated sets.Set and thus
+  don't cause deprecation warning in Python 2.6.
+
 3.5.1 (2009-01-31)
 ------------------
 

Modified: zope.app.publication/trunk/src/zope/app/publication/requestpublicationregistry.py
===================================================================
--- zope.app.publication/trunk/src/zope/app/publication/requestpublicationregistry.py	2009-03-05 00:47:39 UTC (rev 97505)
+++ zope.app.publication/trunk/src/zope/app/publication/requestpublicationregistry.py	2009-03-05 00:49:16 UTC (rev 97506)
@@ -16,8 +16,6 @@
 $Id$
 """
 __docformat__ = 'restructuredtext'
-
-import sets
 from zope.interface import implements
 from zope.app.publication.interfaces import IRequestPublicationRegistry
 from zope.configuration.exceptions import ConfigurationError
@@ -66,7 +64,7 @@
 
         # check if the priorities are unique
         priorities = [item['priority'] for item in l]
-        if len(sets.Set(priorities)) != len(l):
+        if len(set(priorities)) != len(l):
             raise ConfigurationError('All registered publishers for a given '
                                      'method+mimetype must have distinct '
                                      'priorities. Please check your ZCML '



More information about the Checkins mailing list