summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/check_target_files_signatures
diff options
context:
space:
mode:
authordavid <zathrasorama@gmail.com>2011-03-15 14:21:38 +0000
committerYing Wang <wangying@android.com>2011-08-10 17:48:04 -0700
commitcad0bb9f621ff1ccfb584e18249b09768c30a0c0 (patch)
tree1ee78644a8619f6aeec01458d45e5e77695bc14c /tools/releasetools/check_target_files_signatures
parentdceb46559eb8077553d1bd4d738fb4b325af9396 (diff)
downloadbuild-cad0bb9f621ff1ccfb584e18249b09768c30a0c0.zip
build-cad0bb9f621ff1ccfb584e18249b09768c30a0c0.tar.gz
build-cad0bb9f621ff1ccfb584e18249b09768c30a0c0.tar.bz2
sha module is deprecated
This patch removes the deprecated warnings from the python scripts. Change-Id: I052a0aab3fb28dd1d78de1307edafda6b6c35e5f
Diffstat (limited to 'tools/releasetools/check_target_files_signatures')
-rwxr-xr-xtools/releasetools/check_target_files_signatures8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/releasetools/check_target_files_signatures b/tools/releasetools/check_target_files_signatures
index 17aebdc..99bc801 100755
--- a/tools/releasetools/check_target_files_signatures
+++ b/tools/releasetools/check_target_files_signatures
@@ -47,12 +47,16 @@ if sys.hexversion < 0x02040000:
import os
import re
-import sha
import shutil
import subprocess
import tempfile
import zipfile
+try:
+ from hashlib import sha1 as sha1
+except ImportError:
+ from sha import sha as sha1
+
import common
# Work around a bug in python's zipfile module that prevents opening
@@ -112,7 +116,7 @@ class CertDB(object):
self.certs[cert] = self.certs[cert] + "," + name
else:
if name is None:
- name = "unknown cert %s (%s)" % (sha.sha(cert).hexdigest()[:12],
+ name = "unknown cert %s (%s)" % (sha1(cert).hexdigest()[:12],
GetCertSubject(cert))
self.certs[cert] = name