mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-28 23:13:18 +08:00
fix a sith problem with empty files
This commit is contained in:
1 parent
29f89cc75a
commit
a7cfb89c2a
1 file changed
+3
-1
@@ -89,7 +89,9 @@ class TestCase(object):
|
|||||||
source = f.read()
|
source = f.read()
|
||||||
lines = source.splitlines()
|
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]))
|
column = random.randint(0, len(lines[line - 1]))
|
||||||
return cls(operation, path, line, column)
|
return cls(operation, path, line, column)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user