lpschedule-generator

libreplanet schedule generator - ricketyspace.net/lpschedule-generator
git clone git://git.ricketyspace.net/lpschedule-generator.git
Log | Files | Refs

commit 2378aafd0ababffbefc21cfde40f1aadc1d28909
parent 640097f4fe0957edae1479f43c5a173c98bee5b1
Author: rsiddharth <rsd@gnu.org>
Date:   Sat, 19 Dec 2015 18:22:13 -0500

lps_gen.read_file: Added error handling.

Diffstat:
lps_gen.py | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lps_gen.py b/lps_gen.py @@ -48,9 +48,12 @@ def read_file(filename): """ content = '' - with open(filename, 'rb') as f: - for line in f: - content = content + line + try: + with open(filename, 'rb') as f: + for line in f: + content = content + line + except IOError: + print "Error: unable to open %s" % filename return content