From 89bd32e0d7397955afa271371f182a2c4aedbe74 Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 4 Jan 2013 14:55:31 +0100 Subject: [PATCH] use str.splitlines() instead of split('\n'), which is better for non unix systems --- jedi/modules.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/modules.py b/jedi/modules.py index 75c89ff2..4a0b0c90 100644 --- a/jedi/modules.py +++ b/jedi/modules.py @@ -195,7 +195,7 @@ class ModuleWithCursor(Module): def get_line(self, line_nr): if not self._line_cache: - self._line_cache = self.source.split('\n') + self._line_cache = self.source.splitlines() if line_nr == 0: # This is a fix for the zeroth line. We need a newline there, for @@ -218,7 +218,7 @@ class ModuleWithCursor(Module): # TODO check for docstrings length = settings.part_line_length offset = max(self.position[0] - length, 0) - s = '\n'.join(self.source.split('\n')[offset:offset + length]) + s = '\n'.join(self.source.splitlines()[offset:offset + length]) self._part_parser = parsing.PyFuzzyParser(s, self.path, self.position, line_offset=offset) return self._part_parser