소스 검색

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)