[jhbuild] md5 is deprecated
- From: Frederic Peters <fpeters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [jhbuild] md5 is deprecated
- Date: Sat, 1 May 2010 08:33:34 +0000 (UTC)
commit 6d5674c25b30fafe558a9b0d6bba66c9d5fa2fea
Author: Dmitrijs Ledkovs <dmitrij ledkov ubuntu com>
Date: Wed Apr 28 15:12:06 2010 +0100
md5 is deprecated
jhbuild/modtypes/testmodule.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/modtypes/testmodule.py b/jhbuild/modtypes/testmodule.py
index 7456bdc..f9c3719 100644
--- a/jhbuild/modtypes/testmodule.py
+++ b/jhbuild/modtypes/testmodule.py
@@ -19,7 +19,12 @@
__metaclass__ = type
-import os, time, signal, sys, subprocess, random, md5, tempfile
+import os, time, signal, sys, subprocess, random, tempfile
+
+try:
+ import hashlib
+except ImportError:
+ import md5 as hashlib
from jhbuild.errors import FatalError, CommandError, BuildStateError
from jhbuild.modtypes import \
@@ -83,7 +88,7 @@ class TestModule(Package, DownloadableModule):
os.mkdir(os.path.join(tmpdir,'jhbuild.%s' % os.getpid()))
new_xauth = os.path.join(tmpdir, 'jhbuild.%s' % os.getpid(),'Xauthority')
open(new_xauth, 'w').close()
- hexdigest = md5.md5(str(random.random())).hexdigest()
+ hexdigest = hashlib.md5(str(random.random())).hexdigest()
os.system('xauth -f "%s" add ":%s" "." "%s"' % (
new_xauth, servernum, hexdigest))
except OSError:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]