hopefully fixes a long-lasting problem with weakrefs

This commit is contained in:
David Halter
2012-12-05 00:34:18 +01:00
parent dd56b2dcbf
commit 92dea00f0d
3 changed files with 3 additions and 5 deletions

View File

@@ -27,7 +27,6 @@ from __future__ import with_statement
__all__ = ['Script', 'NotFoundError', 'set_debug_function']
import re
import weakref
import parsing
import dynamic
@@ -196,7 +195,7 @@ class Script(object):
except IndexError:
raise NotFoundError()
stmt.start_pos = self.pos
stmt.parent = weakref.ref(self.parser.user_scope)
stmt.parent = lambda: self.parser.user_scope
return stmt
def get_definition(self):

View File

@@ -7,9 +7,8 @@ from os.path import abspath, dirname
import time
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')
sys.path.append('.')
from _compatibility import is_py25, utf8
import api

View File

@@ -5,7 +5,7 @@ import re
import traceback
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')
from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25