Previous 199869 Revisions Next

r36293 Friday 6th March, 2015 at 20:18:30 UTC by Mike Naberezny
chdtest.py: Open as binary, read in chunks to reduce memory usage. (nw)
[src/regtests/chdman]chdtest.py

trunk/src/regtests/chdman/chdtest.py
r244804r244805
3030def sha1sum(path):
3131   if not os.path.exists(path):
3232      return ""
33   sha1 = hashlib.sha1()
34   f = open(path, 'r')
35   sha1.update(f.read())
36   f.close()
33   f = open(path, 'rb')
34   try:
35      sha1 = hashlib.sha1()
36      while True:
37         data = f.read(8192)
38         if data:
39            sha1.update(data)
40         else:
41            break
42   finally:
43      f.close()
3744   return sha1.hexdigest()
3845
3946def extractcdAndCompare(type):


Previous 199869 Revisions Next


© 1997-2024 The MAME Team