Fix collecting runtime type information (PY-17722)

Because of incorrect function name, type information was collected for library functions, but not for project functions
This commit is contained in:
Elizaveta Shashkova
2015-11-26 20:03:35 +03:00
parent 9c157dbba8
commit 5c73bf663e
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -393,7 +393,7 @@ class PyDB:
return self.plugin
def not_in_scope(self, filename):
return pydevd_utils.is_in_project_roots(filename)
return pydevd_utils.not_in_project_roots(filename)
def first_appearance_in_scope(self, trace):
if trace is None or self.not_in_scope(trace.tb_frame.f_code.co_filename):
+3 -2
View File
@@ -32,9 +32,10 @@ class Signature(object):
class SignatureFactory(object):
def __init__(self):
self._caller_cache = {}
self._ignore_module_name = ('__main__', '__builtin__', 'builtins')
def is_in_scope(self, filename):
return pydevd_utils.is_in_project_roots(filename)
return not pydevd_utils.not_in_project_roots(filename)
def create_signature(self, frame):
try:
@@ -50,7 +51,7 @@ class SignatureFactory(object):
tp = locals[name].__class__
class_name = tp.__name__
if hasattr(tp, '__module__') and tp.__module__ and tp.__module__ != '__main__':
if hasattr(tp, '__module__') and tp.__module__ and tp.__module__ not in self._ignore_module_name:
class_name = "%s.%s"%(tp.__module__, class_name)
res.add_arg(name, class_name)
+1 -1
View File
@@ -128,7 +128,7 @@ def _get_project_roots(project_roots_cache=[]):
return project_roots_cache[-1] # returns the project roots with case normalized
def is_in_project_roots(filename, filename_to_not_in_scope_cache={}):
def not_in_project_roots(filename, filename_to_not_in_scope_cache={}):
# Note: the filename_to_not_in_scope_cache is the same instance among the many calls to the method
try:
return filename_to_not_in_scope_cache[filename]