From 3c20c32676bffbfb62030e7fbff04beb8bad5fa9 Mon Sep 17 00:00:00 2001 From: un-pogaz <46523284+un-pogaz@users.noreply.github.com> Date: Thu, 13 Oct 2022 19:53:48 +0200 Subject: [PATCH] fix FrameSummary replacement --- src/calibre/utils/formatter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/formatter.py b/src/calibre/utils/formatter.py index 1e8925c45d..13e678b83b 100644 --- a/src/calibre/utils/formatter.py +++ b/src/calibre/utils/formatter.py @@ -1647,8 +1647,9 @@ class TemplateFormatter(string.Formatter): if getattr(e, 'is_internal', False): # Exception raised by FormatterFuncsCaller # get the line inside the current template instead of the FormatterFuncsCaller - for ss in reversed(traceback.extract_tb(exc_info()[2])): - if ss.filename == '': + for s in reversed(traceback.extract_tb(exc_info()[2])): + if s.filename == '': + ss = s break raise ValueError(_('Error in function {0} on line {1} : {2} - {3}').format(