diff options
author | Julien Olivain <julien.olivain@lsv.ens-cachan.fr> | 2013-08-26 11:52:15 -0400 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2013-08-26 11:52:15 -0400 |
commit | fa7ed7f21ee968e93aa0b09149e4b441ce29bbc5 (patch) | |
tree | e3cf1d43684e8d4a2571233535f3dbc11aa40fb5 | |
parent | 222628c74d2a0186fa369bb36f424c843101b0f6 (diff) |
utils: Fixes grcc to exit with an error code in case of a compilation error.
-rwxr-xr-x | gr-utils/python/utils/grcc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gr-utils/python/utils/grcc b/gr-utils/python/utils/grcc index dbcc89dc0e..e17120a65c 100755 --- a/gr-utils/python/utils/grcc +++ b/gr-utils/python/utils/grcc @@ -42,6 +42,9 @@ class grcc: self.fg.grc_file_path = os.path.abspath(grcfile) self.fg.validate() + if not self.fg.is_valid(): + raise StandardError("Compilation error") + self.gen = self.platform.get_generator()(self.fg, out_dir) self.gen.write() @@ -64,7 +67,11 @@ if __name__ == "__main__": sys.stderr.write("Please specify a GRC file name to compile.\n") sys.exit(1) - g = grcc(args[0], options.directory+"/") + try: + g = grcc(args[0], options.directory+"/") + except: + sys.stderr.write("Error during file compilation.\n"); + sys.exit(1) if(options.execute): g.exec_program() |