diff --git a/sith.py b/sith.py index 022198ff..2c2992e8 100755 --- a/sith.py +++ b/sith.py @@ -89,7 +89,9 @@ class TestCase(object): source = f.read() lines = source.splitlines() - line = random.randint(1, max(len(lines), 1)) + if not lines: + lines = [''] + line = random.randint(1, len(lines)) column = random.randint(0, len(lines[line - 1])) return cls(operation, path, line, column)