Add sanity-check exception

Found by mypy while adding types.
This commit is contained in:
Peter Law
2021-07-24 17:12:34 +01:00
parent 75624f0e3c
commit b9fd84e11c
+3
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()