--- Lib/trace.py Fri Feb 24 15:58:24 2012 +++ Lib/trace.py Wed Oct 30 16:35:49 2013 @@ -135,7 +135,7 @@ self._mods = modules or [] self._dirs = dirs or [] - self._dirs = map(os.path.normpath, self._dirs) + self._dirs = [os.path.normcase(os.path.normpath(d)) for d in self._dirs] self._ignore = { '': 1 } def names(self, filename, modulename): @@ -166,6 +166,8 @@ self._ignore[modulename] = 1 return 1 + filename = os.path.normcase(filename) + # Ignore a file when it contains one of the ignorable paths for d in self._dirs: # The '+ os.sep' is to ensure that d is a parent directory, @@ -575,8 +577,12 @@ if why == 'call': # XXX Should do a better job of identifying methods this_func = self.file_module_function_of(frame) - parent_func = self.file_module_function_of(frame.f_back) - self._callers[(parent_func, this_func)] = 1 + ignore_it = self.ignore.names(this_func[0], this_func[1]) + if not ignore_it: + parent_func = self.file_module_function_of(frame.f_back) + ignore_it = self.ignore.names(parent_func[0], parent_func[1]) + if not ignore_it: + self._callers[(parent_func, this_func)] = 1 def globaltrace_countfuncs(self, frame, why, arg): """Handler for call events. @@ -585,7 +591,9 @@ """ if why == 'call': this_func = self.file_module_function_of(frame) - self._calledfuncs[this_func] = 1 + ignore_it = self.ignore.names(this_func[0], this_func[1]) + if not ignore_it: + self._calledfuncs[this_func] = 1 def globaltrace_lt(self, frame, why, arg): """Handler for call events.