Bug 458936: Work around some bizarre pymake bug.
authorKyle Huey <khuey@kylehuey.com>
Wed, 10 Aug 2011 08:02:40 -0400
changeset 74956 4b6602f8fa7bb9c2c874a01080239bf1bd7a0327
parent 74955 a858541b486f828904567f7822c175048ef9f07e
child 74957 ed019d1cd8ec87d6e20a81d64968a2d80bd86d13
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs458936
milestone8.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 458936: Work around some bizarre pymake bug.
xpcom/idl-parser/typelib.py
--- a/xpcom/idl-parser/typelib.py
+++ b/xpcom/idl-parser/typelib.py
@@ -265,17 +265,17 @@ def write_typelib(idl, fd, filename):
     ifaces = []
     for p in idl.productions:
         if p.kind == 'interface':
             ifaces.append(build_interface(p, ifaces))
 
     typelib = xpt.Typelib(interfaces=ifaces)
     typelib.writefd(fd)
 
-def main(*args):
+if __name__ == '__main__':
     from optparse import OptionParser
     o = OptionParser()
     o.add_option('-I', action='append', dest='incdirs', default=['.'],
                  help="Directory to search for imported files")
     o.add_option('--cachedir', dest='cachedir', default=None,
                  help="Directory in which to cache lex/parse tables.")
     o.add_option('-o', dest='outfile', default=None,
                  help="Output file")
@@ -307,11 +307,8 @@ def main(*args):
     if closeoutfd:
         outfd.close()
 
     if options.depfile is not None:
         depfd = open(options.depfile, 'w')
         deps = [dep.replace('\\', '/') for dep in idl.deps]
 
         print >>depfd, "%s: %s" % (options.outfile, " ".join(deps))
-
-if __name__ == '__main__':
-    main()