##// END OF EJS Templates
Cache debugger skip frame predicate...
Matthias Bussonnier -
Show More
@@ -1,4 +1,3 b''
1 # -*- coding: utf-8 -*-
2 """
1 """
3 Pdb debugger class.
2 Pdb debugger class.
4
3
@@ -103,15 +102,15 b' All the changes since then are under the same license as IPython.'
103
102
104 import inspect
103 import inspect
105 import linecache
104 import linecache
106 import sys
107 import re
108 import os
105 import os
106 import re
107 import sys
108 from contextlib import contextmanager
109 from functools import lru_cache
109
110
110 from IPython import get_ipython
111 from IPython import get_ipython
111 from contextlib import contextmanager
112 from IPython.utils import PyColorize
113 from IPython.utils import coloransi, py3compat
114 from IPython.core.excolors import exception_colors
112 from IPython.core.excolors import exception_colors
113 from IPython.utils import PyColorize, coloransi, py3compat
115
114
116 # skip module docstests
115 # skip module docstests
117 __skip_doctest__ = True
116 __skip_doctest__ = True
@@ -941,11 +940,14 b' class Pdb(OldPdb):'
941 Utility to tell us whether we are in a decorator internal and should stop.
940 Utility to tell us whether we are in a decorator internal and should stop.
942
941
943 """
942 """
944
945 # if we are disabled don't skip
943 # if we are disabled don't skip
946 if not self._predicates["debuggerskip"]:
944 if not self._predicates["debuggerskip"]:
947 return False
945 return False
948
946
947 return self._cachable_skip(frame)
948
949 @lru_cache
950 def _cachable_skip(self, frame):
949 # if frame is tagged, skip by default.
951 # if frame is tagged, skip by default.
950 if DEBUGGERSKIP in frame.f_code.co_varnames:
952 if DEBUGGERSKIP in frame.f_code.co_varnames:
951 return True
953 return True
General Comments 0
You need to be logged in to leave comments. Login now