From 87dc4f304dfe8b792e43064326da083aad24048a Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 2 Sep 2008 10:44:28 -0700 Subject: [PATCH] catch KeyError exception to avoid failing when sqlite or gtk are not installed --- bindings/python/ns3modulegen.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 bindings/python/ns3modulegen.py diff --git a/bindings/python/ns3modulegen.py b/bindings/python/ns3modulegen.py old mode 100644 new mode 100755 index 3ec52493f..e974d3c6a --- a/bindings/python/ns3modulegen.py +++ b/bindings/python/ns3modulegen.py @@ -113,11 +113,17 @@ def main(): # if GtkConfigStore support is disabled, disable the class wrapper if 'DISABLE_GTK_CONFIG_STORE' in os.environ: - root_module.classes.remove(root_module['ns3::GtkConfigStore']) + try: + root_module.classes.remove(root_module['ns3::GtkConfigStore']) + except KeyError: + pass # if no sqlite, the class SqliteDataOutput is disabled if 'SQLITE_STATS' in os.environ: - root_module.classes.remove(root_module['ns3::SqliteDataOutput']) + try: + root_module.classes.remove(root_module['ns3::SqliteDataOutput']) + except KeyError: + pass root_module.generate(out, '_ns3')