summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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