mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Used Path.read_text() in jinja2.get_exception_info().
This commit is contained in:
parent
5bac1719a2
commit
fb05ca420d
@ -99,8 +99,7 @@ def get_exception_info(exception):
|
|||||||
if source is None:
|
if source is None:
|
||||||
exception_file = Path(exception.filename)
|
exception_file = Path(exception.filename)
|
||||||
if exception_file.exists():
|
if exception_file.exists():
|
||||||
with open(exception_file, 'r') as fp:
|
source = exception_file.read_text()
|
||||||
source = fp.read()
|
|
||||||
if source is not None:
|
if source is not None:
|
||||||
lines = list(enumerate(source.strip().split('\n'), start=1))
|
lines = list(enumerate(source.strip().split('\n'), start=1))
|
||||||
during = lines[lineno - 1][1]
|
during = lines[lineno - 1][1]
|
||||||
|
Loading…
Reference in New Issue
Block a user