diff --git a/driver.py b/driver.py index 22d6b06..ef1dc57 100755 --- a/driver.py +++ b/driver.py @@ -40,10 +40,9 @@ tests_path = 'test/' def readfile(fname): '''Reads a file as string and returns its content''' - fd = open(fname, encoding='utf-8') - expr = fd.read() - fd.close() - return expr + with open(fname, encoding='utf-8') as fd: + expr = fd.read() + return expr def load_relations():