##// 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 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 103 import inspect
105 104 import linecache
106 import sys
107 import re
108 105 import os
106 import re
107 import sys
108 from contextlib import contextmanager
109 from functools import lru_cache
109 110
110 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 112 from IPython.core.excolors import exception_colors
113 from IPython.utils import PyColorize, coloransi, py3compat
115 114
116 115 # skip module docstests
117 116 __skip_doctest__ = True
@@ -941,11 +940,14 b' class Pdb(OldPdb):'
941 940 Utility to tell us whether we are in a decorator internal and should stop.
942 941
943 942 """
944
945 943 # if we are disabled don't skip
946 944 if not self._predicates["debuggerskip"]:
947 945 return False
948 946
947 return self._cachable_skip(frame)
948
949 @lru_cache
950 def _cachable_skip(self, frame):
949 951 # if frame is tagged, skip by default.
950 952 if DEBUGGERSKIP in frame.f_code.co_varnames:
951 953 return True
General Comments 0
You need to be logged in to leave comments. Login now