Satisfy mypy
diff --git a/tools/archiver.py b/tools/archiver.py
index f924374..9d364fd 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -430,7 +430,11 @@
):
first_html = Body(part)
except Exception as err:
- print('Error on line {}:'.format(sys.exc_info()[-1].tb_lineno), type(err).__name__, err)
+ entry = sys.exc_info()[-1]
+ if entry: # avoid mypy complaint
+ print('Error on line {}:'.format(entry.tb_lineno), type(err).__name__, err)
+ else: # Should not happen, but just in case
+ print('Failed to create Body(part):',type(err).__name__, err)
# this requires a GPL lib, user will have to install it themselves
if first_html and (