Don't choke on non-existing macros
authorBernie Innocenti <bernie@codewiz.org>
Mon, 1 Dec 2008 00:34:17 +0000 (19:34 -0500)
committerBernie Innocenti <bernie@codewiz.org>
Mon, 1 Dec 2008 00:34:17 +0000 (19:34 -0500)
geekigeeki.py

index a7e99ed10121c9af816cfc76eddc0707edeeec94..6c77adf56231ba1c68ccd4d33dc896d25bb2422b 100755 (executable)
@@ -366,7 +366,11 @@ class WikiFormatter:
 
         macro = globals().get('_macro_' + name)
         if not macro:
-            execfile("macros/" + name + ".py", globals())
+            try:
+                execfile("macros/" + name + ".py", globals())
+            except IOError, er:
+                if er.errno == errno.ENOENT:
+                    pass
             macro = globals().get('_macro_' + name)
         if macro:
             return macro(argv)