diff options
author | rsiddharth <rsd@gnu.org> | 2015-12-19 18:22:13 -0500 |
---|---|---|
committer | rsiddharth <rsd@gnu.org> | 2015-12-19 18:22:13 -0500 |
commit | 2378aafd0ababffbefc21cfde40f1aadc1d28909 (patch) | |
tree | 55777d6386467ea53f7b9a770efe6a3e61acf11e /lps_gen.py | |
parent | 640097f4fe0957edae1479f43c5a173c98bee5b1 (diff) |
lps_gen.read_file: Added error handling.
Diffstat (limited to 'lps_gen.py')
-rw-r--r-- | lps_gen.py | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 |