This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new d12e247  Satisfy mypy
d12e247 is described below

commit d12e247c41f4298028181a4e54f1627e7cc04509
Author: Sebb <s...@apache.org>
AuthorDate: Tue Apr 30 16:06:29 2024 +0100

    Satisfy mypy
---
 tools/archiver.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                 ):
                     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 (

Reply via email to