##// END OF EJS Templates
Disable monkeypatch to inspect.findsource(), leaving explanation.
Thomas Kluyver -
Show More
@@ -126,6 +126,14 b' def inspect_error():'
126 'Below is the traceback from this internal error.\n')
126 'Below is the traceback from this internal error.\n')
127
127
128
128
129 # N.B. This function is a monkeypatch we are currently not applying.
130 # It was written some time ago, to fix an apparent Python bug with
131 # codeobj.co_firstlineno . Unfortunately, we don't know under what conditions
132 # the bug occurred, so we can't tell if it has been fixed. If it reappears, we
133 # will apply the monkeypatch again. Also, note that findsource() is not called
134 # by our code at this time - we don't know if it was when the monkeypatch was
135 # written, or if the monkeypatch is needed for some other code (like a debugger).
136 # For the discussion about not applying it, see gh-1229. TK, Jan 2011.
129 def findsource(object):
137 def findsource(object):
130 """Return the entire source file and starting line number for an object.
138 """Return the entire source file and starting line number for an object.
131
139
@@ -201,9 +209,10 b' def findsource(object):'
201 return lines, lnum
209 return lines, lnum
202 raise IOError('could not find code object')
210 raise IOError('could not find code object')
203
211
212 # Not applying the monkeypatch - see above the function for details. TK, Jan 2012
204 # Monkeypatch inspect to apply our bugfix. This code only works with py25
213 # Monkeypatch inspect to apply our bugfix. This code only works with py25
205 if sys.version_info[:2] >= (2,5):
214 #if sys.version_info[:2] >= (2,5):
206 inspect.findsource = findsource
215 # inspect.findsource = findsource
207
216
208 def fix_frame_records_filenames(records):
217 def fix_frame_records_filenames(records):
209 """Try to fix the filenames in each record from inspect.getinnerframes().
218 """Try to fix the filenames in each record from inspect.getinnerframes().
General Comments 0
You need to be logged in to leave comments. Login now