summaryrefslogtreecommitdiff
path: root/tools/mergestatus.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mergestatus.py')
-rwxr-xr-xtools/mergestatus.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/mergestatus.py b/tools/mergestatus.py
index 80d755e..f47cc68 100755
--- a/tools/mergestatus.py
+++ b/tools/mergestatus.py
@@ -10,6 +10,7 @@ import urllib2
import time
import requests
import base64
+import errno
from base64 import b64encode
from mergetools import parse_args, get_nfetched, hexencode, hexdecode, \
get_logorder, get_sth
@@ -25,7 +26,6 @@ def main():
sthfile = mergedb + "/sth"
currentsizefile = mergedb + "/fetched"
- sth = json.loads(open(sthfile, "r").read())
currentsize = json.loads(open(currentsizefile, "r").read())
print >>sys.stderr, currentsize["index"]+1,
@@ -39,7 +39,12 @@ def main():
print >>sys.stderr, tree["tree_size"],
except (IOError, ValueError):
pass
- print >>sys.stderr, sth["tree_size"],
+ try:
+ sth = json.loads(open(sthfile, "r").read())
+ print >>sys.stderr, sth["tree_size"],
+ except IOError, e:
+ if e.errno != errno.ENOENT:
+ raise
print
if __name__ == '__main__':