mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
use absolute paths as the default for 'Script'
This commit is contained in:
@@ -10,6 +10,7 @@ from __future__ import with_statement
|
||||
__all__ = ['Script', 'NotFoundError', 'set_debug_function', '_quick_complete']
|
||||
|
||||
import re
|
||||
import os
|
||||
|
||||
import parsing
|
||||
import dynamic
|
||||
@@ -59,11 +60,12 @@ class Script(object):
|
||||
self.pos = line, column
|
||||
self._module = modules.ModuleWithCursor(source_path,
|
||||
source=self.source, position=self.pos)
|
||||
self.source_path = source_path
|
||||
self._source_path = source_path
|
||||
self.source_path = os.path.abspath(source_path)
|
||||
debug.speed('init')
|
||||
|
||||
def __repr__(self):
|
||||
return '<%s: %s>' % (self.__class__.__name__, repr(self.source_path))
|
||||
return '<%s: %s>' % (self.__class__.__name__, repr(self._source_path))
|
||||
|
||||
@property
|
||||
def _parser(self):
|
||||
|
||||
@@ -50,7 +50,7 @@ def run_test(source, f_name, lines_to_execute):
|
||||
if lines_to_execute and line_nr - 1 not in lines_to_execute:
|
||||
continue
|
||||
|
||||
path = refactoring_test_dir + os.path.sep + f_name
|
||||
path = os.path.abspath(refactoring_test_dir + os.path.sep + f_name)
|
||||
try:
|
||||
script = api.Script(source, line_nr, index, path)
|
||||
refactor_func = getattr(refactoring, f_name.replace('.py', ''))
|
||||
|
||||
Reference in New Issue
Block a user