From 834a1d720862e52f0cb07356d411e9ff92f10bc8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net>
Date: Fri, 13 Jan 2023 01:19:37 +0100
Subject: [PATCH] fixes bug #19

---
 README.md                       |  1 +
 src/taggingbackends/explorer.py | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index d6b1a6d..e372ac9 100644
--- a/README.md
+++ b/README.md
@@ -193,3 +193,4 @@ JULIA_PROJECT=<path> scripts/larvatagger.jl train
 ```
 with `<path>` the path of the Julia project with TaggingBackends installed.
 
+Note however that the last command above will not work if Julia was installed using juliaup. Prefer [jill](https://pypi.org/project/jill/).
diff --git a/src/taggingbackends/explorer.py b/src/taggingbackends/explorer.py
index c8d123a..2f0e14f 100644
--- a/src/taggingbackends/explorer.py
+++ b/src/taggingbackends/explorer.py
@@ -14,15 +14,15 @@ JULIA_PROJECT = os.environ.get('JULIA_PROJECT', '')
 try:
     from julia import Julia
     Julia(compiled_modules=False)
-except ImportError:
+except:
     logging.warning(f"PyCall not found in JULIA_PROJECT={JULIA_PROJECT}; \
-            please see https://gitlab.pasteur.fr/nyx/TaggingBackends#recommended-installation")
+please see https://gitlab.pasteur.fr/nyx/TaggingBackends#recommended-installation")
 else:
     try:
         from julia import TaggingBackends
     except ImportError:
         logging.warning(f"TaggingBackends not found in JULIA_PROJECT={JULIA_PROJECT}; \
-                please see https://gitlab.pasteur.fr/nyx/TaggingBackends#recommended-installation")
+please see https://gitlab.pasteur.fr/nyx/TaggingBackends#recommended-installation")
 
 def getlogger(name):
     logger = logging.getLogger(name)
@@ -155,7 +155,10 @@ Cannot find any Python package in project root directory:
                     logger.info("\n".join(lines))
                 log(line[len(prefix):].lstrip())
                 return []
-        lines.append(line)
+        if line.startswith("  warn(") or line.startswith("  warnings.warn("):
+            pass
+        else:
+            lines.append(line)
         return lines
 
     def _parse_stderr(self, logger, lines, line):
-- 
GitLab