diff options
author | Colin Walters <walters@verbum.org> | 2010-02-11 16:03:59 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-02-11 16:03:59 -0500 |
commit | a77986a99b26812f1a560fb65e8036d2cf236b3a (patch) | |
tree | db56f7054b10f33d05b5350882e01016ff217d5d /giscanner/transformer.py | |
parent | 46f4446aa87741e63abcc45251bc35087837c3fb (diff) | |
download | gobject-introspection-a77986a99b26812f1a560fb65e8036d2cf236b3a.tar.gz |
[scanner] Print error instead of throwing for unknown include
We should avoid exceptions being propagated to the toplevel.
Diffstat (limited to 'giscanner/transformer.py')
-rw-r--r-- | giscanner/transformer.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/giscanner/transformer.py b/giscanner/transformer.py index f31408fa..2863e731 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -18,7 +18,7 @@ # Boston, MA 02111-1307, USA. # -import os +import os, sys from .ast import (Bitfield, Callback, Enum, Function, Namespace, Member, Parameter, Return, Struct, Field, @@ -125,8 +125,9 @@ class Transformer(object): path = os.path.join(d, girname) if os.path.exists(path): return path - raise ValueError("Couldn't find include %r (search path: %r)"\ + sys.stderr.write("Couldn't find include %r (search path: %r)\n"\ % (girname, searchdirs)) + sys.exit(1) def _parse_include(self, filename): parser = self._cachestore.load(filename) |