mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
fix a sith problem with empty files
This commit is contained in:
4
sith.py
4
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user