diff libervia/server/tasks/implicit/task_brython.py @ 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 a6c7f07f1e4d
children 6d49fae517ba
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(