From f960eda72b309f3079a3c5d31f57e2219da769ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Fri, 25 Mar 2016 19:24:38 +0100 Subject: Switch too broad Exception exceptions to more specific ones (IOError, ImportError) (bzr r14744) --- share/extensions/inkex.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py index 8a51734c3..fbf1d3208 100755 --- a/share/extensions/inkex.py +++ b/share/extensions/inkex.py @@ -112,12 +112,12 @@ def are_near_relative(a, b, eps): # third party library try: from lxml import etree -except Exception, e: +except ImportError as e: localize() errormsg(_("The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension." "Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, " "or install it through your package manager by a command like: sudo apt-get install " - "python-lxml\n\nTechnical details:\n%s" % (e,))) + "python-lxml\n\nTechnical details:\n%s" % (e, ))) sys.exit() @@ -178,7 +178,7 @@ class Effect: if filename is not None: try: stream = open(filename, 'r') - except Exception: + except IOError: errormsg(_("Unable to open specified file: %s") % filename) sys.exit() @@ -187,7 +187,7 @@ class Effect: elif self.svg_file is not None: try: stream = open(self.svg_file, 'r') - except Exception: + except IOError: errormsg(_("Unable to open object member file: %s") % self.svg_file) sys.exit() -- cgit v1.2.3