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/scannermain.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/scannermain.py')
-rw-r--r-- | giscanner/scannermain.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index cc70fdee..44c0287d 100644 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -276,7 +276,11 @@ def scanner_main(args): for include in options.includes: if os.sep in include: raise ValueError("Invalid include path %r" % (include, )) - include_obj = Include.from_string(include) + try: + include_obj = Include.from_string(include) + except: + sys.stderr.write("Malformed include %r\n" % (include, )) + sys.exit(1) transformer.register_include(include_obj) packages = set(options.packages) |