From 12ffdaad96e5a85bde4be353b6cf6e1a51d020ca Mon Sep 17 00:00:00 2001 From: Artur Gaspar Date: Mon, 18 Dec 2023 14:50:43 -0300 Subject: [PATCH] fix: handle exceptions without a message attribute on compile translations E.g. FileNotFoundError. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a8dc26c..13b50c8 100644 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ def compile_translations(self): self.announce('Compiling translation at %s' % po_path) subprocess.check_call(['msgfmt', po_path, '-o', mo_path], cwd=self.install_lib) except Exception as ex: - self.announce('Translations compilation failed: %s' % ex.message) + self.announce('Translations compilation failed: %s' % getattr(ex, 'message', str(ex))) def package_data(pkg, root_list):