mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
hopefully fixes a long-lasting problem with weakrefs
This commit is contained in:
@@ -27,7 +27,6 @@ from __future__ import with_statement
|
|||||||
__all__ = ['Script', 'NotFoundError', 'set_debug_function']
|
__all__ = ['Script', 'NotFoundError', 'set_debug_function']
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import weakref
|
|
||||||
|
|
||||||
import parsing
|
import parsing
|
||||||
import dynamic
|
import dynamic
|
||||||
@@ -196,7 +195,7 @@ class Script(object):
|
|||||||
except IndexError:
|
except IndexError:
|
||||||
raise NotFoundError()
|
raise NotFoundError()
|
||||||
stmt.start_pos = self.pos
|
stmt.start_pos = self.pos
|
||||||
stmt.parent = weakref.ref(self.parser.user_scope)
|
stmt.parent = lambda: self.parser.user_scope
|
||||||
return stmt
|
return stmt
|
||||||
|
|
||||||
def get_definition(self):
|
def get_definition(self):
|
||||||
|
|||||||
@@ -7,9 +7,8 @@ from os.path import abspath, dirname
|
|||||||
import time
|
import time
|
||||||
import functools
|
import functools
|
||||||
|
|
||||||
sys.path.append(abspath(dirname(abspath(__file__)) + '/../jedi'))
|
sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/../jedi'))
|
||||||
os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/../jedi')
|
os.chdir(os.path.dirname(os.path.abspath(__file__)) + '/../jedi')
|
||||||
sys.path.append('.')
|
|
||||||
|
|
||||||
from _compatibility import is_py25, utf8
|
from _compatibility import is_py25, utf8
|
||||||
import api
|
import api
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import re
|
|||||||
import traceback
|
import traceback
|
||||||
from os.path import abspath, dirname
|
from os.path import abspath, dirname
|
||||||
|
|
||||||
sys.path.append(abspath(dirname(abspath(__file__)) + '/../jedi'))
|
sys.path.insert(0, abspath(dirname(abspath(__file__)) + '/../jedi'))
|
||||||
os.chdir(dirname(abspath(__file__)) + '/../jedi')
|
os.chdir(dirname(abspath(__file__)) + '/../jedi')
|
||||||
|
|
||||||
from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25
|
from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25
|
||||||
|
|||||||
Reference in New Issue
Block a user