mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Disallow empty sapi_embedded_dir
flag in the header generator
Ignore cursors with types that are not implemented in python bindings PiperOrigin-RevId: 333708345 Change-Id: I618a61c960247a9bdf89bc56dcac92e2d37b3220
This commit is contained in:
parent
35f9268e23
commit
1b8e8aa757
|
@ -580,12 +580,11 @@ class _TranslationUnit(object):
|
||||||
|
|
||||||
for i, cursor in enumerate(self._walk_preorder()):
|
for i, cursor in enumerate(self._walk_preorder()):
|
||||||
# Workaround for issue#32
|
# Workaround for issue#32
|
||||||
|
# ignore all the cursors with kinds not implemented in python bindings
|
||||||
try:
|
try:
|
||||||
cursor.kind
|
cursor.kind
|
||||||
except ValueError:
|
except ValueError:
|
||||||
if cursor._kind_id >= 440: # pylint: disable=protected-access
|
|
||||||
continue
|
continue
|
||||||
raise
|
|
||||||
# naive way to order types: they should be ordered when walking the tree
|
# naive way to order types: they should be ordered when walking the tree
|
||||||
if cursor.kind.is_declaration():
|
if cursor.kind.is_declaration():
|
||||||
self.order[cursor.hash] = i
|
self.order[cursor.hash] = i
|
||||||
|
@ -911,7 +910,7 @@ class Generator(object):
|
||||||
result.append('#include "sandboxed_api/sandbox.h"')
|
result.append('#include "sandboxed_api/sandbox.h"')
|
||||||
result.append('#include "sandboxed_api/vars.h"')
|
result.append('#include "sandboxed_api/vars.h"')
|
||||||
|
|
||||||
if (embed_dir is not None) and (embed_name is not None):
|
if embed_dir and embed_name:
|
||||||
result.append(
|
result.append(
|
||||||
Generator.EMBED_INCLUDE.format(
|
Generator.EMBED_INCLUDE.format(
|
||||||
os.path.join(embed_dir, embed_name) + '_embed.h'))
|
os.path.join(embed_dir, embed_name) + '_embed.h'))
|
||||||
|
@ -928,7 +927,7 @@ class Generator(object):
|
||||||
|
|
||||||
result.append('')
|
result.append('')
|
||||||
|
|
||||||
if (embed_dir is not None) and (embed_name is not None):
|
if embed_dir and embed_name:
|
||||||
result.append(
|
result.append(
|
||||||
Generator.EMBED_CLASS.format(name, embed_name.replace('-', '_')))
|
Generator.EMBED_CLASS.format(name, embed_name.replace('-', '_')))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user