Bug 691781 - Add a check to avoid unpacking an empty array. r=khuey
authorBobby Holley <bobbyholley@gmail.com>
Sun, 06 Nov 2011 13:32:25 +0100
changeset 81210 b240ea529d1fdeb6a12bf1063bdcdeecdfaee050
parent 81206 1ff33773f17e0d96a04692f2a848a06b4f6f957a
child 81211 cf0e3297e58ce02234c4dc614ba33164709edded
push id434
push userclegnitto@mozilla.com
push dateWed, 21 Dec 2011 12:10:54 +0000
treeherdermozilla-beta@bddb6ed8dd47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs691781
milestone10.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 691781 - Add a check to avoid unpacking an empty array. r=khuey
xpcom/idl-parser/header.py
xpcom/idl-parser/typelib.py
--- a/xpcom/idl-parser/header.py
+++ b/xpcom/idl-parser/header.py
@@ -481,17 +481,17 @@ if __name__ == '__main__':
                  help="Directory in which to cache lex/parse tables.")
     o.add_option('-o', dest='outfile', default=None,
                  help="Output file (default is stdout)")
     o.add_option('-d', dest='depfile', default=None,
                  help="Generate a make dependency file")
     o.add_option('--regen', action='store_true', dest='regen', default=False,
                  help="Regenerate IDL Parser cache")
     options, args = o.parse_args()
-    file, = args
+    file = args[0] if args else None
 
     if options.cachedir is not None:
         if not os.path.isdir(options.cachedir):
             os.mkdir(options.cachedir)
         sys.path.append(options.cachedir)
 
     if options.regen:
         if options.cachedir is None:
--- a/xpcom/idl-parser/typelib.py
+++ b/xpcom/idl-parser/typelib.py
@@ -280,17 +280,17 @@ if __name__ == '__main__':
                  help="Directory in which to cache lex/parse tables.")
     o.add_option('-o', dest='outfile', default=None,
                  help="Output file")
     o.add_option('-d', dest='depfile', default=None,
                  help="Generate a make dependency file")
     o.add_option('--regen', action='store_true', dest='regen', default=False,
                  help="Regenerate IDL Parser cache")
     options, args = o.parse_args()
-    file, = args
+    file = args[0] if args else None
 
     if options.cachedir is not None:
         if not os.path.isdir(options.cachedir):
             os.mkdir(options.cachedir)
         sys.path.append(options.cachedir)
 
     if options.regen:
         if options.cachedir is None: