mirror of
https://github.com/davidhalter/jedi.git
synced 2026-01-30 15:55:23 +08:00
Use unicode always for getting special objects
This commit is contained in:
@@ -111,7 +111,7 @@ class Evaluator(object):
|
||||
@property
|
||||
@evaluator_function_cache()
|
||||
def builtins_module(self):
|
||||
return compiled.get_special_object(self, 'BUILTINS')
|
||||
return compiled.get_special_object(self, u'BUILTINS')
|
||||
|
||||
def reset_recursion_limitations(self):
|
||||
self.recursion_detector = recursion.RecursionDetector()
|
||||
|
||||
@@ -83,9 +83,9 @@ class FunctionContext(use_metaclass(CachedMetaClass, TreeContext)):
|
||||
# This differentiation is only necessary for Python2. Python3 does not
|
||||
# use a different method class.
|
||||
if isinstance(parser_utils.get_parent_scope(self.tree_node), tree.Class):
|
||||
name = 'METHOD_CLASS'
|
||||
name = u'METHOD_CLASS'
|
||||
else:
|
||||
name = 'FUNCTION_CLASS'
|
||||
name = u'FUNCTION_CLASS'
|
||||
return compiled.get_special_object(self.evaluator, name)
|
||||
|
||||
@property
|
||||
|
||||
@@ -67,7 +67,7 @@ class GeneratorMixin(object):
|
||||
return ContextSet.from_sets(lazy_context.infer() for lazy_context in self.py__iter__())
|
||||
|
||||
def get_filters(self, search_global, until_position=None, origin_scope=None):
|
||||
gen_obj = compiled.get_special_object(self.evaluator, 'GENERATOR_OBJECT')
|
||||
gen_obj = compiled.get_special_object(self.evaluator, u'GENERATOR_OBJECT')
|
||||
yield SpecialMethodFilter(self, self.builtin_methods, gen_obj)
|
||||
for filter in gen_obj.get_filters(search_global):
|
||||
yield filter
|
||||
@@ -76,7 +76,7 @@ class GeneratorMixin(object):
|
||||
return True
|
||||
|
||||
def py__class__(self):
|
||||
gen_obj = compiled.get_special_object(self.evaluator, 'GENERATOR_OBJECT')
|
||||
gen_obj = compiled.get_special_object(self.evaluator, u'GENERATOR_OBJECT')
|
||||
return gen_obj.py__class__()
|
||||
|
||||
@property
|
||||
|
||||
@@ -204,7 +204,7 @@ class ModuleContext(use_metaclass(CachedMetaClass, TreeContext)):
|
||||
return names
|
||||
|
||||
def py__class__(self):
|
||||
return compiled.get_special_object(self.evaluator, 'MODULE_CLASS')
|
||||
return compiled.get_special_object(self.evaluator, u'MODULE_CLASS')
|
||||
|
||||
def __repr__(self):
|
||||
return "<%s: %s@%s-%s>" % (
|
||||
|
||||
Reference in New Issue
Block a user