Просмотр исходного кода

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

Taddeus Kroes 14 лет назад
Родитель
Сommit
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)