Преглед на файлове

Now, when a non-existing file is opened, an exception is raised.

Taddeus Kroes преди 14 години
родител
ревизия
744612234b
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      src/parser.py

+ 1 - 1
src/parser.py

@@ -123,6 +123,6 @@ def parse_file(filename):
         content = open(filename).read()
         yacc.parse(content)
     except IOError:
-        print 'File "%s" could not be opened' % filename
+        raise Exception('File "%s" could not be opened' % filename)
 
     return Block(statements)