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)
# Boston, MA 02111-1307, USA.
#
-import os
+import os, sys
from .ast import (Bitfield, Callback, Enum, Function, Namespace, Member,
Parameter, Return, Struct, Field,
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)