summaryrefslogtreecommitdiffstats
path: root/lps_gen.py
diff options
context:
space:
mode:
authorrsiddharth <rsd@gnu.org>2015-12-19 18:22:13 -0500
committerrsiddharth <rsd@gnu.org>2015-12-19 18:22:13 -0500
commit2378aafd0ababffbefc21cfde40f1aadc1d28909 (patch)
tree55777d6386467ea53f7b9a770efe6a3e61acf11e /lps_gen.py
parent640097f4fe0957edae1479f43c5a173c98bee5b1 (diff)
lps_gen.read_file: Added error handling.
Diffstat (limited to 'lps_gen.py')
-rw-r--r--lps_gen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lps_gen.py b/lps_gen.py
index 00d6b42..d6072fe 100644
--- 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