[Checkins] SVN: z3c.authenticator/trunk/ - Fixed deprecation warnings.
Michael Howitz
mh at gocept.com
Fri Jan 21 02:48:01 EST 2011
Log message for revision 119810:
- Fixed deprecation warnings.
Changed:
U z3c.authenticator/trunk/CHANGES.txt
U z3c.authenticator/trunk/buildout.cfg
U z3c.authenticator/trunk/src/z3c/authenticator/tests.py
U z3c.authenticator/trunk/src/z3c/authenticator/user.py
-=-
Modified: z3c.authenticator/trunk/CHANGES.txt
===================================================================
--- z3c.authenticator/trunk/CHANGES.txt 2011-01-21 00:39:05 UTC (rev 119809)
+++ z3c.authenticator/trunk/CHANGES.txt 2011-01-21 07:48:00 UTC (rev 119810)
@@ -7,6 +7,9 @@
- Bugfix: Did not handle unicode IUser.login values.
+- Fixed DeprecationWarnings.
+
+
0.8.0 (2010-01-25)
------------------
Modified: z3c.authenticator/trunk/buildout.cfg
===================================================================
--- z3c.authenticator/trunk/buildout.cfg 2011-01-21 00:39:05 UTC (rev 119809)
+++ z3c.authenticator/trunk/buildout.cfg 2011-01-21 07:48:00 UTC (rev 119810)
@@ -1,7 +1,11 @@
[buildout]
develop = .
parts = test checker coverage-test coverage-report
+versions = versions
+# versions needed for Python 2.4 compatibility:
+[versions]
+ZODB3 = 3.9.5
[test]
recipe = zc.recipe.testrunner
Modified: z3c.authenticator/trunk/src/z3c/authenticator/tests.py
===================================================================
--- z3c.authenticator/trunk/src/z3c/authenticator/tests.py 2011-01-21 00:39:05 UTC (rev 119809)
+++ z3c.authenticator/trunk/src/z3c/authenticator/tests.py 2011-01-21 07:48:00 UTC (rev 119810)
@@ -11,24 +11,18 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
-$Id:$
-"""
-__docformat__ = "reStructuredText"
-
-import unittest
-from zope.testing import doctest
-from zope.app.testing import placelesssetup
-
-from z3c.testing import InterfaceBaseTest
-from z3c.testing import BaseTestIContainer
-from z3c.authenticator import interfaces
from z3c.authenticator import authentication
from z3c.authenticator import credential
from z3c.authenticator import group
-from z3c.authenticator import user
+from z3c.authenticator import interfaces
from z3c.authenticator import principal
from z3c.authenticator import testing
+from z3c.authenticator import user
+from z3c.testing import BaseTestIContainer
+from z3c.testing import InterfaceBaseTest
+from zope.app.testing import placelesssetup
+import doctest
+import unittest
class AuthenticatorTest(BaseTestIContainer):
Modified: z3c.authenticator/trunk/src/z3c/authenticator/user.py
===================================================================
--- z3c.authenticator/trunk/src/z3c/authenticator/user.py 2011-01-21 00:39:05 UTC (rev 119809)
+++ z3c.authenticator/trunk/src/z3c/authenticator/user.py 2011-01-21 07:48:00 UTC (rev 119810)
@@ -16,7 +16,10 @@
"""
__docformat__ = "reStructuredText"
-import md5
+try:
+ from hashlib import md5
+except ImportError: # BBB for Python 2.4
+ from md5 import md5
import random
import time
import socket
@@ -45,7 +48,7 @@
except UnicodeEncodeError:
id = id.encode('utf-8')
data = str(ip)+' '+str(t)+' '+str(r)+' '+id
- return unicode(md5.md5(data).hexdigest())
+ return unicode(md5(data).hexdigest())
class User(persistent.Persistent, contained.Contained):
More information about the checkins
mailing list