sha module is deprecated
This patch removes the deprecated warnings from the python scripts. Change-Id: I052a0aab3fb28dd1d78de1307edafda6b6c35e5f
This commit is contained in:
@@ -20,7 +20,6 @@ import imp
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
import sha
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
@@ -29,6 +28,11 @@ import threading
|
||||
import time
|
||||
import zipfile
|
||||
|
||||
try:
|
||||
from hashlib import sha1 as sha1
|
||||
except ImportError:
|
||||
from sha import sha as sha1
|
||||
|
||||
# missing in Python 2.4 and before
|
||||
if not hasattr(os, "SEEK_SET"):
|
||||
os.SEEK_SET = 0
|
||||
@@ -659,7 +663,7 @@ class File(object):
|
||||
self.name = name
|
||||
self.data = data
|
||||
self.size = len(data)
|
||||
self.sha1 = sha.sha(data).hexdigest()
|
||||
self.sha1 = sha1(data).hexdigest()
|
||||
|
||||
def WriteToTemp(self):
|
||||
t = tempfile.NamedTemporaryFile()
|
||||
|
Reference in New Issue
Block a user