From b7fc562c888f1c71c5b462c5cb612455625d838c Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 28 May 2019 08:52:45 +0200 Subject: [PATCH] Also skip librsvg import on AttributeError MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the case python-gobject isn’t installed, but another package (such as libibus) provides overrides, the gi module will still get imported fine despite being empty, resulting in a traceback. To prevent this, we also catch AttributeError so that gi.require_version can fail. --- poezio/windows/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poezio/windows/image.py b/poezio/windows/image.py index dfd2eae2..ebecb5ad 100644 --- a/poezio/windows/image.py +++ b/poezio/windows/image.py @@ -20,7 +20,7 @@ try: from gi.repository import Rsvg import cairo HAS_RSVG = True -except (ImportError, ValueError): +except (ImportError, ValueError, AttributeError): HAS_RSVG = False from poezio.windows.base_wins import Win