Commit f7024258 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Shut up a deprecation warning in Python 2.6.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30909 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d4565882
...@@ -40,7 +40,10 @@ from cStringIO import StringIO ...@@ -40,7 +40,10 @@ from cStringIO import StringIO
from xml.dom.minidom import parse from xml.dom.minidom import parse
from xml.sax.saxutils import escape, quoteattr from xml.sax.saxutils import escape, quoteattr
import os import os
import md5 try:
from hashlib import md5
except ImportError:
from md5 import md5
from interfaces.query_catalog import ISearchKeyCatalog from interfaces.query_catalog import ISearchKeyCatalog
from zope.interface.verify import verifyClass from zope.interface.verify import verifyClass
...@@ -1039,7 +1042,7 @@ class Catalog(Folder, ...@@ -1039,7 +1042,7 @@ class Catalog(Folder,
random_factor_list.append(os.getloadavg()) random_factor_list.append(os.getloadavg())
except (OSError, AttributeError): # AttributeError is required under cygwin except (OSError, AttributeError): # AttributeError is required under cygwin
pass pass
instance_id = md5.new(str(random_factor_list)).hexdigest() instance_id = md5(str(random_factor_list)).hexdigest()
uid_list = [x.uid for x in method(count = UID_BUFFER_SIZE, instance_id = instance_id) if x.uid != 0] uid_list = [x.uid for x in method(count = UID_BUFFER_SIZE, instance_id = instance_id) if x.uid != 0]
uid_buffer.extend(uid_list) uid_buffer.extend(uid_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment