# HG changeset patch # User catherine.devlin@gmail.com # Date 1296605793 18000 # Node ID 0eea48bd3ad6a55f11da3c691534ef6ecd8b3235 # Parent 539c11ad1b7e624ae20e245484e2bedfdd5a9efb handling md5 import for py2.4 diff -r 539c11ad1b7e -r 0eea48bd3ad6 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Mon Jan 31 19:56:25 2011 -0500 +++ b/sqlpython/sqlpyPlus.py Tue Feb 01 19:16:33 2011 -0500 @@ -24,7 +24,11 @@ - catherinedevlin.blogspot.com May 31, 2006 """ import sys, os, re, sqlpython, pyparsing, re, completion -import datetime, pickle, binascii, subprocess, time, itertools, hashlib +import datetime, pickle, binascii, subprocess, time, itertools +try: + from hashlib import md5 +except ImportError: + from md5 import new as md5 import traceback, operator from cmd2 import Cmd, make_option, options, Statekeeper, Cmd2TestCase, options_defined import operator @@ -236,7 +240,7 @@ self.url = '' if under_limit: self.blob = blob.read() - self.hashed = hashlib.md5(self.blob).hexdigest() + self.hashed = md5(self.blob).hexdigest() self.extension = imagedetect.extension_from_data(self.blob) if self.folder_ok(): self.file_name = '%s/%s%s' % (