From 204626b67151a759bd1e18dc176c97598e27ec3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 28 Feb 2018 17:23:43 +0100 Subject: [PATCH] Fix issue when library blend file does not exist --- blender_asset_tracer/tracer/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blender_asset_tracer/tracer/__init__.py b/blender_asset_tracer/tracer/__init__.py index 06ae82a..9b06869 100644 --- a/blender_asset_tracer/tracer/__init__.py +++ b/blender_asset_tracer/tracer/__init__.py @@ -60,8 +60,10 @@ class _Tracer: # Convert bytes to pathlib.Path object so we have a nice interface to work with. # This assumes the path is encoded in UTF-8. - path = pathlib.Path(abspath.decode()).resolve() - if not path.exists(): + path = pathlib.Path(abspath.decode()) + try: + path = path.resolve() + except FileNotFoundError: log.warning('Linked blend file %s (%s) does not exist; skipping.', relpath, path) return