Search code examples
pythonmodulemd5ply

md5 module error


I'm using an older version of PLY that uses the md5 module (among others):

import re, types, sys, cStringIO, md5, os.path

... although the script runs but not without this error:

DeprecationWarning: the md5 module is deprecated; use hashlib instead

How do I fix it so the error goes away?

Thanks


Solution

  • I think the warning message is quite straightforward. You need to:

    from hashlib import md5
    

    or you can use python < 2.5, http://docs.python.org/library/md5.html