summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@gnome.org>2010-09-01 21:26:37 -0300
committerJohan Dahlin <johan@gnome.org>2010-09-01 21:26:37 -0300
commit47d1f9c949d37ad792c82d70a0043668db66e576 (patch)
treea3aeff7b1b68a75fa7821d8edc4a41cc8799f1f1
parentc687a08855735a1cf7b346517d53cec8588210bb (diff)
downloadgobject-introspection-47d1f9c949d37ad792c82d70a0043668db66e576.tar.gz
[scannermain] Use _error() consistently
-rw-r--r--giscanner/scannermain.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index b0902361..f50ae161 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -174,7 +174,7 @@ def test_codegen(optstring):
gen = EverythingCodeGenerator(out_h_filename, out_c_filename)
gen.write()
else:
- raise ValueError("Invaild namespace %r" % (namespace, ))
+ _error("Invaild namespace %r" % (namespace, ))
return 0
def validate(assertions, path):
@@ -291,12 +291,11 @@ def scanner_main(args):
shown_include_warning = False
for include in options.includes:
if os.sep in include:
- raise ValueError("Invalid include path %r" % (include, ))
+ _error("Invalid include path %r" % (include, ))
try:
include_obj = Include.from_string(include)
except:
- sys.stderr.write("Malformed include %r\n" % (include, ))
- return 1
+ _error("Malformed include %r\n" % (include, ))
transformer.register_include(include_obj)
packages = set(options.packages)
@@ -371,8 +370,8 @@ def scanner_main(args):
passthrough_gir(main_f.name, temp_f)
temp_f.close()
if not files_are_identical(main_f.name, temp_f.name):
- raise SystemExit(
-"Failed to re-parse .gir file; scanned=%r passthrough=%r" % (main_f.name, temp_f.name))
+ _error("Failed to re-parse gir file; scanned=%r passthrough=%r" % (
+ main_f.name, temp_f.name))
os.unlink(temp_f.name)
try:
shutil.move(main_f.name, options.output)