On Wed, 2012-07-11 at 14:45 -0300, Cleber Rosa wrote:
> Get rid of DeprecationWarning messages on newer Python version while still
> making it run on properly on Python 2.4

Nice! I meant to send a patch for that, but never got around actually
doing it. LGTM.

> Signed-off-by: Cleber Rosa <cr...@redhat.com>
> ---
>  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',


_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to