From dce6f4a232e034f207700dfcf9adf52fc8215a4e Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 9 Aug 2013 17:15:57 +0430 Subject: [PATCH] fix unicode problems in sith.py --- sith.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sith.py b/sith.py index 9e15a42d..8c768318 100755 --- a/sith.py +++ b/sith.py @@ -111,9 +111,7 @@ class TestCase(object): def run(self, debugger, record=None, print_result=False): try: with open(self.path) as f: - self.file = f.read() - self.script = jedi.Script(self.file, self.line, self.column, - self.path) + self.script = jedi.Script(f.read(), self.line, self.column, self.path) self.completions = getattr(self.script, self.operation)() if print_result: self.show_location(self.line, self.column) @@ -138,7 +136,7 @@ class TestCase(object): def show_location(self, lineno, column, show=3): # Three lines ought to be enough lower = lineno - show if lineno - show > 0 else 0 - for i, line in enumerate(self.file.split('\n')[lower:lineno]): + for i, line in enumerate(self.script.source.split('\n')[lower:lineno]): print(lower + i + 1, line) print(' ' * (column + len(str(lineno))), '^')