diff --git django/views/debug.py django/views/debug.py
index 3414cb1..5490d5f 100644
|
|
class ExceptionReporter(object):
|
347 | 347 | if source is None: |
348 | 348 | try: |
349 | 349 | with open(filename, 'rb') as fp: |
350 | | source = fp.readlines() |
| 350 | source = fp.read().splitlines() |
351 | 351 | except (OSError, IOError): |
352 | 352 | pass |
353 | 353 | if source is None: |
… |
… |
class ExceptionReporter(object):
|
366 | 366 | lower_bound = max(0, lineno - context_lines) |
367 | 367 | upper_bound = lineno + context_lines |
368 | 368 | |
369 | | pre_context = [line.strip('\n') for line in source[lower_bound:lineno]] |
370 | | context_line = source[lineno].strip('\n') |
371 | | post_context = [line.strip('\n') for line in source[lineno+1:upper_bound]] |
| 369 | pre_context = source[lower_bound:lineno] |
| 370 | context_line = source[lineno] |
| 371 | post_context = source[lineno+1:upper_bound] |
372 | 372 | |
373 | 373 | return lower_bound, pre_context, context_line, post_context |
374 | 374 | |