mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 12:59:02 +02:00
patch.bbclass: use hashlib with Python 2.5+ - removes DeprecationWarning
This commit is contained in:
parent
d2c268aec8
commit
31bdfe582e
|
@ -7,10 +7,18 @@ def patch_init(d):
|
|||
import os, sys
|
||||
|
||||
def md5sum(fname):
|
||||
import md5, sys
|
||||
import sys
|
||||
|
||||
# when we move to Python 2.5 as minimal supported
|
||||
# we can kill that try/except as hashlib is 2.5+
|
||||
try:
|
||||
import hashlib
|
||||
m = hashlib.md5()
|
||||
except ImportError:
|
||||
import md5
|
||||
m = md5.new()
|
||||
|
||||
f = file(fname, 'rb')
|
||||
m = md5.new()
|
||||
while True:
|
||||
d = f.read(8096)
|
||||
if not d:
|
||||
|
|
Loading…
Reference in New Issue
Block a user