From 07d5287f42ececa2e059724c7c5bba55c8658bc6 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Thu, 11 Sep 2014 09:22:39 -0400 Subject: [PATCH] Catch error when done reading files --- contrib/linearize/linearize-data.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 383bb3819..3b5d198c1 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -110,7 +110,11 @@ def copydata(settings, blkindex, blkset): if not inF: fname = "%s/blk%05d.dat" % (settings['input'], inFn) print("Input file" + fname) - inF = open(fname, "rb") + try: + inF = open(fname, "rb") + except IOError: + print "Done" + return inhdr = inF.read(8) if (not inhdr or (inhdr[0] == "\0")):