1
0
forked from VimPlug/jedi

new splitlines implementation to get rid of the ugly splitlines we now have as well as (partially) the issue with form feeds

This commit is contained in:
Dave Halter
2014-07-18 16:52:55 +02:00
parent 0f665bf436
commit ffaacbefbc
2 changed files with 11 additions and 3 deletions

View File

@@ -86,9 +86,7 @@ class Script(object):
with open(path) as f:
source = f.read()
lines = source.splitlines() or ['']
if source and source[-1] == '\n':
lines.append('')
lines = common.splitlines(source)
line = max(len(lines), 1) if line is None else line
if not (0 < line <= len(lines)):
raise ValueError('`line` parameter is not in a valid range.')