catch KeyError exception to avoid failing when sqlite or gtk are not installed
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Tue, 02 Sep 2008 10:44:28 -0700
changeset 3582 96fa2a7b5f88
parent 3576 f6abfdf47163
child 3583 b6cf80679b72
catch KeyError exception to avoid failing when sqlite or gtk are not installed
bindings/python/ns3modulegen.py
--- a/bindings/python/ns3modulegen.py	Tue Sep 02 10:12:14 2008 -0700
+++ b/bindings/python/ns3modulegen.py	Tue Sep 02 10:44:28 2008 -0700
@@ -113,11 +113,17 @@
 
     # 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')