changeset 1250:821b6ce57f99

server (tasks/brython): log an error if brython is missing and needed
author Goffi <goffi@goffi.org>
date Mon, 27 Apr 2020 10:55:23 +0200
parents 560d381943d8
children a1606e2a92eb
files libervia/server/tasks/implicit/task_brython.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/server/tasks/implicit/task_brython.py	Sun Apr 26 22:15:48 2020 +0200
+++ b/libervia/server/tasks/implicit/task_brython.py	Mon Apr 27 10:55:23 2020 +0200
@@ -41,7 +41,11 @@
                     )
                     installed_ver = None
 
-        import brython
+        try:
+            import brython
+        except ModuleNotFoundError as e:
+            log.error('"brython" module is missing, can\'t use browser code for Brython')
+            raise e
         ver = [int(v) for v in brython.implementation.split('.')[:3]]
         if ver != installed_ver:
             log.info(_("Installing Brython v{version}").format(