Commit 738d4b40 authored by Jim Fulton's avatar Jim Fulton

Got rid of a deprecation warning on Python 2.6.

parent 1236d51e
......@@ -19,16 +19,20 @@ from ZODB.fstools import prev_txn
import binascii
import getopt
import sha
import sys
try:
from hashlib import sha1
except ImportError:
from sha import sha as sha1
def main(path, ntxn):
f = open(path, "rb")
f.seek(0, 2)
th = prev_txn(f)
i = ntxn
while th and i > 0:
hash = sha.sha(th.get_raw_data()).digest()
hash = sha1(th.get_raw_data()).digest()
l = len(str(th.get_timestamp())) + 1
th.read_meta()
print "%s: hash=%s" % (th.get_timestamp(),
......@@ -47,7 +51,6 @@ def Main():
if k == '-n':
ntxn = int(v)
main(path, ntxn)
if __name__ == "__main__":
Main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment