From 274cc65c4e2eb781a26a1485c212fc311b2bbb63 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 26 Apr 2007 12:34:05 -0400 Subject: [PATCH] Use hashlib on python 2.5 --- services/presence/server_plugin.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/services/presence/server_plugin.py b/services/presence/server_plugin.py index c3323375..ec49f32e 100644 --- a/services/presence/server_plugin.py +++ b/services/presence/server_plugin.py @@ -23,7 +23,8 @@ import gtk from buddyiconcache import BuddyIconCache import logging import os -import md5 + +import sys import psutils from telepathy.client import ConnectionManager, ManagerRegistry, Connection, Channel @@ -343,7 +344,14 @@ class ServerPlugin(gobject.GObject): if not icon_data: icon_data = self._owner.props.icon - m = md5.new() + m = None + if sys.version_info[:3] >= (2, 5, 0): + import hashlib + m = hashlib.md5() + else: + import md5 + m = md5.new() + m.update(icon_data) hash = m.hexdigest()