Throw an error on empty arguments

Fixes #290
This commit is contained in:
JustAnotherArchivist
2021-10-10 17:43:27 +00:00
parent 5e829e2541
commit a6b6f3faaa
8 changed files with 25 additions and 11 deletions

View File

@@ -217,3 +217,13 @@ class Scraper:
@classmethod
def _construct(cls, argparseArgs, *args, **kwargs):
return cls(*args, **kwargs, retries = argparseArgs.retries)
def nonempty_string(name):
def f(s):
s = s.strip()
if s:
return s
raise ValueError('must not be an empty string')
f.__name__ = name
return f