From 4ec13c0f6b0261bfb5ef86fed67b397d9940fc32 Mon Sep 17 00:00:00 2001 From: pradal Date: Thu, 18 Sep 2025 11:59:41 +0200 Subject: [PATCH 1/2] Fix import error in oalab --- src/openalea/core/resources/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openalea/core/resources/__init__.py b/src/openalea/core/resources/__init__.py index 4df204d..38f7975 100644 --- a/src/openalea/core/resources/__init__.py +++ b/src/openalea/core/resources/__init__.py @@ -1,3 +1,6 @@ -import importlib_resources as resources +try: + from importlib import resources +except ImportError: + import importlib_resources as resources resources_dir = resources.files(__name__) From 0c872ba6897580565ebeb4cb4285f297c0f55e3c Mon Sep 17 00:00:00 2001 From: pradal Date: Thu, 18 Sep 2025 12:30:11 +0200 Subject: [PATCH 2/2] another error... --- src/openalea/core/formatting/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openalea/core/formatting/util.py b/src/openalea/core/formatting/util.py index 6179a53..137c4b3 100644 --- a/src/openalea/core/formatting/util.py +++ b/src/openalea/core/formatting/util.py @@ -40,10 +40,10 @@ def icon_path(filepath, default=None, paths=None, packages=None): if packages is None: packages = [] # Search filename in all paths given by user - _paths = [Path(filepath)] + [Path(p) / filepath for p in paths] + _paths = [Path(str(filepath))] + [Path(str(p)) / filepath for p in paths] # Search icons generated by oalab - _paths += [Path(p) / '._icon.png' for p in paths] + _paths += [Path(str(p)) / '._icon.png' for p in paths] # If a path is found, try to find absolute path # Try to get icon path from object