Ticket #13958: patch_13958.diff
File patch_13958.diff, 1023 bytes (added by , 13 years ago) |
---|
-
django/views/debug.py
329 329 try: 330 330 f = open(filename) 331 331 try: 332 source = f.read lines()332 source = f.read().splitlines() 333 333 finally: 334 334 f.close() 335 335 except (OSError, IOError): … … 350 350 lower_bound = max(0, lineno - context_lines) 351 351 upper_bound = lineno + context_lines 352 352 353 pre_context = [line.strip('\n') for line in source[lower_bound:lineno]]354 context_line = source[lineno] .strip('\n')355 post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]]353 pre_context = source[lower_bound:lineno] 354 context_line = source[lineno] 355 post_context = source[lineno+1:upper_bound] 356 356 357 357 return lower_bound, pre_context, context_line, post_context 358 358