Get rid of DeprecationWarning messages on newer Python version while still making it run on properly on Python 2.4
Signed-off-by: Cleber Rosa <[email protected]> --- client/tools/boottool.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/client/tools/boottool.py b/client/tools/boottool.py index 6868c14..5f5db67 100755 --- a/client/tools/boottool.py +++ b/client/tools/boottool.py @@ -7,7 +7,16 @@ A boottool clone, but written in python and relying mostly on grubby[1]. ''' import os, re, sys, optparse, logging, subprocess -import urllib, tarfile, tempfile, shutil, struct, md5 +import urllib, tarfile, tempfile, shutil, struct + +# +# Get rid of DeprecationWarning messages on newer Python version while still +# making it run on properly on Python 2.4 +# +try: + import hashlib as md5 +except ImportError: + import md5 __all__ = ['Grubby', 'OptionParser', 'App', 'EfiVar', 'EfiToolSys', -- 1.7.10.4 _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
