[Erp5-report] r39449 kazuhiko - /erp5/trunk/products/ERP5Form/ListBox.py

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 21 16:52:46 CEST 2010


Author: kazuhiko
Date: Thu Oct 21 16:52:40 2010
New Revision: 39449

URL: http://svn.erp5.org?rev=39449&view=rev
Log:
remove DeprecationWarning on python-2.6.

Modified:
    erp5/trunk/products/ERP5Form/ListBox.py

Modified: erp5/trunk/products/ERP5Form/ListBox.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Form/ListBox.py?rev=39449&r1=39448&r2=39449&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Form/ListBox.py [utf8] (original)
+++ erp5/trunk/products/ERP5Form/ListBox.py [utf8] Thu Oct 21 16:52:40 2010
@@ -51,7 +51,10 @@ from Products.PythonScripts.Utility impo
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from warnings import warn
 
-import md5
+try:
+  from hashlib import md5 as md5_new
+except ImportError:
+  from md5 import new as md5_new
 import cgi
 
 DEFAULT_LISTBOX_DISPLAY_STYLE = 'table'
@@ -2565,7 +2568,7 @@ class ListBoxHTMLRenderer(ListBoxRendere
     if checked_uid_list is not None:
       checked_uid_list = [str(uid) for uid in checked_uid_list]
       checked_uid_list.sort()
-      md5_string = md5.new(str(checked_uid_list)).hexdigest()
+      md5_string = md5_new(str(checked_uid_list)).hexdigest()
     else:
       md5_string = None
 




More information about the Erp5-report mailing list