diff options
| author | Raphaël Bournhonesque <raphael0202@yahoo.fr> | 2016-03-25 18:24:38 +0000 |
|---|---|---|
| committer | Raphaël Bournhonesque <raphael0202@yahoo.fr> | 2016-03-25 18:24:38 +0000 |
| commit | f960eda72b309f3079a3c5d31f57e2219da769ec (patch) | |
| tree | 0bf670570a78ccab944ed82eb5122f7dc8331094 | |
| parent | Cosmetics to make inkex.py pep8 compliant (diff) | |
| download | inkscape-f960eda72b309f3079a3c5d31f57e2219da769ec.tar.gz inkscape-f960eda72b309f3079a3c5d31f57e2219da769ec.zip | |
Switch too broad Exception exceptions to more specific ones (IOError, ImportError)
(bzr r14744)
| -rwxr-xr-x | share/extensions/inkex.py | 8 |
1 files 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() |
