diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-02-11 10:35:51 +0100 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-03-02 13:14:09 -0600 |
commit | 181feaf3555136dd7883e2434c4498ca1939bf1a (patch) | |
tree | e93b451d7e9fec7e56ad92d18af56b13cfb1d6cf /scripts/qapi | |
parent | 71a7510baf8a5745eb844ab289f007ff8bbbee41 (diff) |
qapi: Lift error reporting from QAPISchema.__init__() to callers
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180211093607.27351-14-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r-- | scripts/qapi/common.py | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 60a4748606..4cc4d3ee8f 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -16,7 +16,6 @@ import errno import os import re import string -import sys try: from collections import OrderedDict except: @@ -1459,19 +1458,15 @@ class QAPISchemaEvent(QAPISchemaEntity): class QAPISchema(object): def __init__(self, fname): - try: - parser = QAPISchemaParser(open(fname, 'r')) - exprs = check_exprs(parser.exprs) - self.docs = parser.docs - self._entity_dict = {} - self._predefining = True - self._def_predefineds() - self._predefining = False - self._def_exprs(exprs) - self.check() - except QAPIError as err: - print(err, file=sys.stderr) - exit(1) + parser = QAPISchemaParser(open(fname, 'r')) + exprs = check_exprs(parser.exprs) + self.docs = parser.docs + self._entity_dict = {} + self._predefining = True + self._def_predefineds() + self._predefining = False + self._def_exprs(exprs) + self.check() def _def_entity(self, ent): # Only the predefined types are allowed to not have info |