git.openpandora.org
/
openembedded.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5f722a
)
patch.bbclass: use hashlib with Python 2.5+ - removes DeprecationWarning
author
Marcin Juszkiewicz
<marcin@juszkiewicz.com.pl>
Tue, 12 May 2009 16:30:18 +0000
(18:30 +0200)
committer
Marcin Juszkiewicz
<hrw@openembedded.org>
Tue, 12 May 2009 16:35:10 +0000
(18:35 +0200)
classes/patch.bbclass
patch
|
blob
|
history
diff --git
a/classes/patch.bbclass
b/classes/patch.bbclass
index
075e826
..
8d2bde0
100644
(file)
--- a/
classes/patch.bbclass
+++ b/
classes/patch.bbclass
@@
-13,14
+13,22
@@
def patch_init(d):
return "Error: %s not found." % self.path
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()
try:
f = file(fname, 'rb')
except IOError:
raise NotFoundError(fname)
- m = md5.new()
while True:
d = f.read(8096)
if not d: