Add sanity-check exception

Found by mypy while adding types.
This commit is contained in:
Peter Law
2020-08-30 15:48:54 +01:00
parent 75624f0e3c
commit b9fd84e11c

View File

@@ -105,6 +105,9 @@ class Script:
self.path = path.absolute() if path else None
if code is None:
if path is None:
raise ValueError("Must provide at least one of code or path")
# TODO add a better warning than the traceback!
with open(path, 'rb') as f:
code = f.read()