mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Fix an issue that comes from a combination of property/__slots__/pickle
This commit is contained in:
@@ -62,6 +62,21 @@ class FastModule(pr.SubModule):
|
|||||||
return "<fast.%s: %s@%s-%s>" % (type(self).__name__, self.name,
|
return "<fast.%s: %s@%s-%s>" % (type(self).__name__, self.name,
|
||||||
self.start_pos[0], self.end_pos[0])
|
self.start_pos[0], self.end_pos[0])
|
||||||
|
|
||||||
|
# To avoid issues with with the `parser.Parser`, we need setters that do
|
||||||
|
# nothing, because if pickle comes along and sets those values.
|
||||||
|
@global_names.setter
|
||||||
|
def global_names(self, value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@error_statement_stacks.setter
|
||||||
|
def error_statement_stacks(self, value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@used_names.setter
|
||||||
|
def used_names(self, value):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MergedNamesDict(object):
|
class MergedNamesDict(object):
|
||||||
def __init__(self, dicts):
|
def __init__(self, dicts):
|
||||||
|
|||||||
@@ -614,7 +614,7 @@ class SubModule(Scope, Module):
|
|||||||
of a module.
|
of a module.
|
||||||
"""
|
"""
|
||||||
__slots__ = ('path', 'global_names', 'used_names', '_name',
|
__slots__ = ('path', 'global_names', 'used_names', '_name',
|
||||||
'use_as_parent', 'error_statement_stacks')
|
'error_statement_stacks')
|
||||||
type = 'file_input'
|
type = 'file_input'
|
||||||
|
|
||||||
def __init__(self, children):
|
def __init__(self, children):
|
||||||
@@ -628,7 +628,6 @@ class SubModule(Scope, Module):
|
|||||||
"""
|
"""
|
||||||
super(SubModule, self).__init__(children)
|
super(SubModule, self).__init__(children)
|
||||||
self.path = None # Set later.
|
self.path = None # Set later.
|
||||||
# this may be changed depending on fast_parser
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@cache.underscore_memoization
|
@cache.underscore_memoization
|
||||||
|
|||||||
Reference in New Issue
Block a user