Bug 1468273 - Fix dom by hand for flake8 draft
authorSylvestre Ledru <sledru@mozilla.com>
Tue, 12 Jun 2018 23:05:54 -0700
changeset 806991 3dc36e6936f2bd6b92f531a877daeed853749529
parent 806990 932ba0302098ad01dc0e2e948ef2113d45c4bc76
child 806992 5a153861b34b1a430a0129ef5923c3e063c95980
push id113016
push usersledru@mozilla.com
push dateWed, 13 Jun 2018 06:14:54 +0000
bugs1468273
milestone62.0a1
Bug 1468273 - Fix dom by hand for flake8 MozReview-Commit-ID: KdevWW2bk2e
dom/bindings/Codegen.py
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_any_null.py
dom/bindings/parser/tests/test_argument_identifier_conflicts.py
dom/bindings/parser/tests/test_argument_novoid.py
dom/bindings/parser/tests/test_arraybuffer.py
dom/bindings/parser/tests/test_attr.py
dom/bindings/parser/tests/test_attr_sequence_type.py
dom/bindings/parser/tests/test_builtin_filename.py
dom/bindings/parser/tests/test_builtins.py
dom/bindings/parser/tests/test_bytestring.py
dom/bindings/parser/tests/test_callback.py
dom/bindings/parser/tests/test_callback_interface.py
dom/bindings/parser/tests/test_cereactions.py
dom/bindings/parser/tests/test_conditional_dictionary_member.py
dom/bindings/parser/tests/test_const.py
dom/bindings/parser/tests/test_constructor.py
dom/bindings/parser/tests/test_constructor_no_interface_object.py
dom/bindings/parser/tests/test_deduplicate.py
dom/bindings/parser/tests/test_dictionary.py
dom/bindings/parser/tests/test_distinguishability.py
dom/bindings/parser/tests/test_double_null.py
dom/bindings/parser/tests/test_duplicate_qualifiers.py
dom/bindings/parser/tests/test_empty_enum.py
dom/bindings/parser/tests/test_empty_sequence_default_value.py
dom/bindings/parser/tests/test_enum.py
dom/bindings/parser/tests/test_enum_duplicate_values.py
dom/bindings/parser/tests/test_error_colno.py
dom/bindings/parser/tests/test_error_lineno.py
dom/bindings/parser/tests/test_exposed_extended_attribute.py
dom/bindings/parser/tests/test_extended_attributes.py
dom/bindings/parser/tests/test_float_types.py
dom/bindings/parser/tests/test_forward_decl.py
dom/bindings/parser/tests/test_global_extended_attr.py
dom/bindings/parser/tests/test_identifier_conflict.py
dom/bindings/parser/tests/test_implements.py
dom/bindings/parser/tests/test_incomplete_parent.py
dom/bindings/parser/tests/test_incomplete_types.py
dom/bindings/parser/tests/test_interface.py
dom/bindings/parser/tests/test_interface_const_identifier_conflicts.py
dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py
dom/bindings/parser/tests/test_interface_maplikesetlikeiterable.py
dom/bindings/parser/tests/test_lenientSetter.py
dom/bindings/parser/tests/test_method.py
dom/bindings/parser/tests/test_namespace.py
dom/bindings/parser/tests/test_newobject.py
dom/bindings/parser/tests/test_nullable_equivalency.py
dom/bindings/parser/tests/test_nullable_void.py
dom/bindings/parser/tests/test_optional_constraints.py
dom/bindings/parser/tests/test_overload.py
dom/bindings/parser/tests/test_promise.py
dom/bindings/parser/tests/test_prototype_ident.py
dom/bindings/parser/tests/test_putForwards.py
dom/bindings/parser/tests/test_record.py
dom/bindings/parser/tests/test_replaceable.py
dom/bindings/parser/tests/test_securecontext_extended_attribute.py
dom/bindings/parser/tests/test_special_method_signature_mismatch.py
dom/bindings/parser/tests/test_special_methods.py
dom/bindings/parser/tests/test_special_methods_uniqueness.py
dom/bindings/parser/tests/test_stringifier.py
dom/bindings/parser/tests/test_toJSON.py
dom/bindings/parser/tests/test_treatNonCallableAsNull.py
dom/bindings/parser/tests/test_typedef.py
dom/bindings/parser/tests/test_unenumerable_own_properties.py
dom/bindings/parser/tests/test_unforgeable.py
dom/bindings/parser/tests/test_union.py
dom/bindings/parser/tests/test_union_any.py
dom/bindings/parser/tests/test_union_nullable.py
dom/bindings/parser/tests/test_usvstring.py
dom/bindings/parser/tests/test_variadic_callback.py
dom/bindings/parser/tests/test_variadic_constraints.py
dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py
dom/canvas/test/webgl-conf/checkout/deqp/build.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py
dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py
dom/canvas/test/webgl-conf/checkout/py/lint/lint.py
dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py
dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
dom/canvas/test/webgl-conf/import.py
dom/canvas/test/webgl-mochitest/mochi-to-testcase.py
dom/media/test/graph_latency.py
dom/security/test/csp/file_upgrade_insecure_wsh.py
dom/security/test/csp/file_websocket_self_wsh.py
dom/security/test/mixedcontentblocker/file_main_bug803225_websocket_wsh.py
dom/websocket/tests/file_websocket_basic_wsh.py
dom/websocket/tests/file_websocket_bigBlob_wsh.py
dom/websocket/tests/file_websocket_hello_wsh.py
dom/websocket/tests/file_websocket_permessage_deflate_disabled_wsh.py
dom/websocket/tests/file_websocket_permessage_deflate_params_wsh.py
dom/websocket/tests/file_websocket_permessage_deflate_rejected_wsh.py
dom/websocket/tests/file_websocket_permessage_deflate_wsh.py
dom/websocket/tests/file_websocket_wsh.py
dom/websocket/tests/websocket_hybi/file_check-binary-messages_wsh.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2594,19 +2594,19 @@ class AttrDefiner(PropertyDefiner):
             attributes = [m for m in descriptor.interface.members if
                           m.isAttr() and m.isStatic() == static and
                           MemberIsUnforgeable(m, descriptor) == unforgeable and
                           not isNonExposedNavigatorObjectGetter(m, descriptor)]
         else:
             attributes = []
 
         attributes = [
-            {"name": name, "attr": attr}
+            {"name": name_attr, "attr": attr}
             for attr in attributes
-            for name in [attr.identifier.name] + attr.bindingAliases
+            for name_attr in [attr.identifier.name] + attr.bindingAliases
         ]
 
         self.chrome = [m for m in attributes if isChromeOnly(m["attr"])]
         self.regular = [m for m in attributes if not isChromeOnly(m["attr"])]
         self.static = static
         self.unforgeable = unforgeable
 
         if static:
@@ -9844,19 +9844,16 @@ class CGEnum(CGThing):
             enum class ${name} : ${ty} {
               $*{enums}
               EndGuard_
             };
             """,
             name=self.enum.identifier.name,
             ty=self.underlyingType(),
             enums=",\n".join(map(getEnumValueName, self.enum.values())) + ",\n")
-        strings = CGNamespace(self.stringsNamespace(),
-                              CGGeneric(declare="extern const EnumEntry %s[%d];\n"
-                                        % (ENUM_ENTRY_VARIABLE_NAME, self.nEnumStrings())))
         return decl + "\n" + self.cgThings.declare()
 
     def define(self):
         return self.cgThings.define()
 
     def deps(self):
         return self.enum.getDeps()
 
@@ -11472,17 +11469,16 @@ class CGDOMJSProxyHandler_getOwnPropDesc
                 Argument('JS::Handle<jsid>', 'id'),
                 Argument('bool', 'ignoreNamedProps'),
                 Argument('JS::MutableHandle<JS::PropertyDescriptor>', 'desc')]
         ClassMethod.__init__(self, "getOwnPropDescriptor", "bool", args,
                              virtual=True, override=True, const=True)
         self.descriptor = descriptor
 
     def getBody(self):
-        indexedGetter = self.descriptor.operations['IndexedGetter']
         indexedSetter = self.descriptor.operations['IndexedSetter']
 
         if self.descriptor.supportsIndexedProperties():
             readonly = toStringBool(indexedSetter is None)
             fillDescriptor = "FillPropertyDescriptor(desc, proxy, %s);\nreturn true;\n" % readonly
             templateValues = {
                 'jsvalRef': 'desc.value()',
                 'jsvalHandle': 'desc.value()',
@@ -13576,18 +13572,18 @@ class CGRegisterWorkerBindings(CGAbstrac
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
             condition = "!%s::GetConstructorObject(aCx)" % bindingNS
             if desc.isExposedConditionally():
                 condition = (
                     "%s::ConstructorEnabled(aCx, aObj) && " % bindingNS
                     + condition)
             conditions.append(condition)
-        lines = [CGIfWrapper(CGGeneric("return false;\n"), condition) for
-                 condition in conditions]
+        lines = [CGIfWrapper(CGGeneric("return false;\n"), cond) for
+                 cond in conditions]
         lines.append(CGGeneric("return true;\n"))
         return CGList(lines, "\n").define()
 
 
 class CGRegisterWorkerDebuggerBindings(CGAbstractMethod):
     def __init__(self, config):
         CGAbstractMethod.__init__(self, None, 'RegisterWorkerDebuggerBindings', 'bool',
                                   [Argument('JSContext*', 'aCx'),
@@ -13602,18 +13598,18 @@ class CGRegisterWorkerDebuggerBindings(C
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
             condition = "!%s::GetConstructorObject(aCx)" % bindingNS
             if desc.isExposedConditionally():
                 condition = (
                     "%s::ConstructorEnabled(aCx, aObj) && " % bindingNS
                     + condition)
             conditions.append(condition)
-        lines = [CGIfWrapper(CGGeneric("return false;\n"), condition) for
-                 condition in conditions]
+        lines = [CGIfWrapper(CGGeneric("return false;\n"), cond) for
+                 cond in conditions]
         lines.append(CGGeneric("return true;\n"))
         return CGList(lines, "\n").define()
 
 
 class CGRegisterWorkletBindings(CGAbstractMethod):
     def __init__(self, config):
         CGAbstractMethod.__init__(self, None, 'RegisterWorkletBindings', 'bool',
                                   [Argument('JSContext*', 'aCx'),
@@ -13628,18 +13624,18 @@ class CGRegisterWorkletBindings(CGAbstra
         for desc in descriptors:
             bindingNS = toBindingNamespace(desc.name)
             condition = "!%s::GetConstructorObject(aCx)" % bindingNS
             if desc.isExposedConditionally():
                 condition = (
                     "%s::ConstructorEnabled(aCx, aObj) && " % bindingNS
                     + condition)
             conditions.append(condition)
-        lines = [CGIfWrapper(CGGeneric("return false;\n"), condition) for
-                 condition in conditions]
+        lines = [CGIfWrapper(CGGeneric("return false;\n"), cond) for
+                 cond in conditions]
         lines.append(CGGeneric("return true;\n"))
         return CGList(lines, "\n").define()
 
 
 class CGSystemBindingInitIds(CGAbstractMethod):
     def __init__(self):
         CGAbstractMethod.__init__(self, None, 'SystemBindingInitIds', 'bool',
                                   [Argument('JSContext*', 'aCx')])
@@ -15377,20 +15373,16 @@ class CGJSImplClass(CGBindingImplClass):
 
         if descriptor.interface.parent:
             parentClass = descriptor.getDescriptor(
                 descriptor.interface.parent.identifier.name).jsImplParent
             baseClasses = [ClassBase(parentClass)]
             isupportsDecl = "NS_DECL_ISUPPORTS_INHERITED\n"
             ccDecl = ("NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(%s, %s)\n" %
                       (descriptor.name, parentClass))
-            constructorBody = dedent("""
-                // Make sure we're an nsWrapperCache already
-                MOZ_ASSERT(static_cast<nsWrapperCache*>(this));
-                """)
             extradefinitions = fill(
                 """
                 NS_IMPL_CYCLE_COLLECTION_INHERITED(${ifaceName}, ${parentClass}, mImpl, mParent)
                 NS_IMPL_ADDREF_INHERITED(${ifaceName}, ${parentClass})
                 NS_IMPL_RELEASE_INHERITED(${ifaceName}, ${parentClass})
                 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(${ifaceName})
                 NS_INTERFACE_MAP_END_INHERITING(${parentClass})
                 """,
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -2574,17 +2574,18 @@ class IDLUnionType(IDLType):
 
         self.name = "Or".join(typeName(type) for type in self.memberTypes)
         self.flatMemberTypes = list(self.memberTypes)
         i = 0
         while i < len(self.flatMemberTypes):
             if self.flatMemberTypes[i].nullable():
                 if self.hasNullableType:
                     raise WebIDLError("Can't have more than one nullable types in a union",
-                                      [nullableType.location, self.flatMemberTypes[i].location])
+                                      [self.flatMemberTypes[i].location,
+                                       self.flatMemberTypes[i].location])
                 if self.hasDictionaryType():
                     raise WebIDLError("Can't have a nullable type and a "
                                       "dictionary type in a union",
                                       [self._dictionaryType.location,
                                        self.flatMemberTypes[i].location])
                 self.hasNullableType = True
                 nullableType = self.flatMemberTypes[i]
                 self.flatMemberTypes[i] = self.flatMemberTypes[i].inner
@@ -3612,17 +3613,17 @@ class IDLInterfaceMember(IDLObjectWithId
         self.dependsOn = dependsOn
 
     def _setAffects(self, affects):
         if self.affects != "Everything":
             raise WebIDLError("Trying to specify multiple different Affects, "
                               "Pure, or Constant extended attributes for "
                               "attribute", [self.location])
         if affects not in IDLInterfaceMember.AffectsValues:
-            raise WebIDLError("Invalid [Affects=%s] on attribute" % dependsOn,
+            raise WebIDLError("Invalid [Affects=%s] on attribute" % self.dependsOn,
                               [self.location])
         self.affects = affects
 
     def _addAlias(self, alias):
         if alias in self.aliases:
             raise WebIDLError("Duplicate [Alias=%s] on attribute" % alias,
                               [self.location])
         self.aliases.append(alias)
--- a/dom/bindings/parser/tests/test_any_null.py
+++ b/dom/bindings/parser/tests/test_any_null.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface DoubleNull {
               attribute any? foo;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_argument_identifier_conflicts.py
+++ b/dom/bindings/parser/tests/test_argument_identifier_conflicts.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface ArgumentIdentifierConflict {
               void foo(boolean arg1, boolean arg1);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_argument_novoid.py
+++ b/dom/bindings/parser/tests/test_argument_novoid.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface VoidArgument1 {
               void foo(void arg2);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_arraybuffer.py
+++ b/dom/bindings/parser/tests/test_arraybuffer.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestArrayBuffer {
           attribute ArrayBuffer bufferAttr;
           void bufferMethod(ArrayBuffer arg1, ArrayBuffer? arg2, sequence<ArrayBuffer> arg3);
 
           attribute ArrayBufferView viewAttr;
           void viewMethod(ArrayBufferView arg1, ArrayBufferView? arg2, sequence<ArrayBufferView> arg3);
@@ -31,17 +32,17 @@ def WebIDLTest(parser, harness):
           void uint32ArrayMethod(Uint32Array arg1, Uint32Array? arg2, sequence<Uint32Array> arg3);
 
           attribute Float32Array float32ArrayAttr;
           void float32ArrayMethod(Float32Array arg1, Float32Array? arg2, sequence<Float32Array> arg3);
 
           attribute Float64Array float64ArrayAttr;
           void float64ArrayMethod(Float64Array arg1, Float64Array? arg2, sequence<Float64Array> arg3);
         };
-    """)
+    """)  # NOQA: E501
 
     results = parser.finish()
 
     iface = results[0]
 
     harness.ok(True, "TestArrayBuffer interface parsed without error")
     harness.check(len(iface.members), 22, "Interface should have twenty two members")
 
@@ -57,21 +58,22 @@ def WebIDLTest(parser, harness):
         (retType, arguments) = method.signatures()[0]
         harness.ok(retType.isVoid(), "Should have a void return type")
         harness.check(len(arguments), 3, "Expect 3 arguments")
 
         harness.check(str(arguments[0].type), t,  "Expect an ArrayBuffer type")
         harness.ok(arguments[0].type.isSpiderMonkeyInterface(), "Should test as a js interface")
 
         harness.check(str(arguments[1].type), t + "OrNull",  "Expect an ArrayBuffer type")
-        harness.ok(arguments[1].type.inner.isSpiderMonkeyInterface(), "Should test as a js interface")
+        harness.ok(arguments[1].type.inner.isSpiderMonkeyInterface(),
+                   "Should test as a js interface")
 
         harness.check(str(arguments[2].type), t + "Sequence",  "Expect an ArrayBuffer type")
-        harness.ok(arguments[2].type.inner.isSpiderMonkeyInterface(), "Should test as a js interface")
-
+        harness.ok(arguments[2].type.inner.isSpiderMonkeyInterface(),
+                   "Should test as a js interface")
 
     checkStuff(members[0],  members[1],  "ArrayBuffer")
     checkStuff(members[2],  members[3],  "ArrayBufferView")
     checkStuff(members[4],  members[5],  "Int8Array")
     checkStuff(members[6],  members[7],  "Uint8Array")
     checkStuff(members[8],  members[9],  "Uint8ClampedArray")
     checkStuff(members[10], members[11], "Int16Array")
     checkStuff(members[12], members[13], "Uint16Array")
--- a/dom/bindings/parser/tests/test_attr.py
+++ b/dom/bindings/parser/tests/test_attr.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     testData = [("::TestAttr%s::b", "b", "Byte%s", False),
                 ("::TestAttr%s::rb", "rb", "Byte%s", True),
                 ("::TestAttr%s::o", "o", "Octet%s", False),
                 ("::TestAttr%s::ro", "ro", "Octet%s", True),
                 ("::TestAttr%s::s", "s", "Short%s", False),
                 ("::TestAttr%s::rs", "rs", "Short%s", True),
                 ("::TestAttr%s::us", "us", "UnsignedShort%s", False),
@@ -78,17 +79,17 @@ def WebIDLTest(parser, harness):
           readonly attribute float? rf;
         };
     """)
 
     results = parser.finish()
 
     def checkAttr(attr, QName, name, type, readonly):
         harness.ok(isinstance(attr, WebIDL.IDLAttribute),
-                  "Should be an IDLAttribute")
+                   "Should be an IDLAttribute")
         harness.ok(attr.isAttr(), "Attr is an Attr")
         harness.ok(not attr.isMethod(), "Attr is not an method")
         harness.ok(not attr.isConst(), "Attr is not a const")
         harness.check(attr.identifier.QName(), QName, "Attr has the right QName")
         harness.check(attr.identifier.name, name, "Attr has the right name")
         harness.check(str(attr.type), type, "Attr has the right type")
         harness.check(attr.readonly, readonly, "Attr's readonly state is correct")
 
@@ -128,50 +129,50 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
           interface A {
             [SetterThrows] readonly attribute boolean foo;
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow [SetterThrows] on readonly attributes")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [Throw] readonly attribute boolean foo;
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should spell [Throws] correctly")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [SameObject] readonly attribute boolean foo;
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow [SameObject] on attributes not of interface type")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [SameObject] readonly attribute A foo;
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(not threw, "Should allow [SameObject] on attributes of interface type")
--- a/dom/bindings/parser/tests/test_attr_sequence_type.py
+++ b/dom/bindings/parser/tests/test_attr_sequence_type.py
@@ -2,66 +2,66 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface AttrSequenceType {
               attribute sequence<object> foo;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Attribute type must not be a sequence type")
 
     parser.reset()
 
     threw = False
     try:
         parser.parse("""
             interface AttrUnionWithSequenceType {
               attribute (sequence<object> or DOMString) foo;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Attribute type must not be a union with a sequence member type")
 
     parser.reset()
 
     threw = False
     try:
         parser.parse("""
             interface AttrNullableUnionWithSequenceType {
               attribute (sequence<object>? or DOMString) foo;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Attribute type must not be a union with a nullable sequence "
                "member type")
 
     parser.reset()
 
     threw = False
     try:
         parser.parse("""
             interface AttrUnionWithUnionWithSequenceType {
               attribute ((sequence<object> or DOMString) or AttrUnionWithUnionWithSequenceType) foo;
             };
-        """)
+        """)  # NOQA: E501
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Attribute type must not be a union type with a union member "
                "type that has a sequence member type")
--- a/dom/bindings/parser/tests/test_builtin_filename.py
+++ b/dom/bindings/parser/tests/test_builtin_filename.py
@@ -1,11 +1,9 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface Test {
           attribute long b;
         };
-    """);
+    """)
 
     attr = parser.finish()[0].members[0]
     harness.check(attr.type.filename(), '<builtin>', 'Filename on builtin type')
--- a/dom/bindings/parser/tests/test_builtins.py
+++ b/dom/bindings/parser/tests/test_builtins.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestBuiltins {
           attribute boolean b;
           attribute byte s8;
           attribute octet u8;
           attribute short s16;
           attribute unsigned short u16;
@@ -26,16 +27,18 @@ def WebIDLTest(parser, harness):
     harness.check(iface.identifier.QName(), "::TestBuiltins", "Interface has the right QName")
     harness.check(iface.identifier.name, "TestBuiltins", "Interface has the right name")
     harness.check(iface.parent, None, "Interface has no parent")
 
     members = iface.members
     harness.check(len(members), 10, "Should be one production")
 
     names = ["b", "s8", "u8", "s16", "u16", "s32", "u32", "s64", "u64", "ts"]
-    types = ["Boolean", "Byte", "Octet", "Short", "UnsignedShort", "Long", "UnsignedLong", "LongLong", "UnsignedLongLong", "UnsignedLongLong"]
+    types = ["Boolean", "Byte", "Octet", "Short", "UnsignedShort", "Long",
+             "UnsignedLong", "LongLong", "UnsignedLongLong", "UnsignedLongLong"]
     for i in range(10):
         attr = members[i]
         harness.ok(isinstance(attr, WebIDL.IDLAttribute), "Should be an IDLAttribute")
-        harness.check(attr.identifier.QName(), "::TestBuiltins::" + names[i], "Attr has correct QName")
+        harness.check(attr.identifier.QName(), "::TestBuiltins::" +
+                      names[i], "Attr has correct QName")
         harness.check(attr.identifier.name, names[i], "Attr has correct name")
         harness.check(str(attr.type), types[i], "Attr type is the correct name")
         harness.ok(attr.type.isPrimitive(), "Should be a primitive type")
--- a/dom/bindings/parser/tests/test_bytestring.py
+++ b/dom/bindings/parser/tests/test_bytestring.py
@@ -1,21 +1,22 @@
 # -*- coding: UTF-8 -*-
 
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestByteString {
           attribute ByteString bs;
           attribute DOMString ds;
           };
     """)
 
-    results = parser.finish();
+    results = parser.finish()
 
     harness.ok(True, "TestByteString interface parsed without error.")
 
     harness.check(len(results), 1, "Should be one production")
     harness.ok(isinstance(results[0], WebIDL.IDLInterface),
                "Should be an IDLInterface")
     iface = results[0]
     harness.check(iface.identifier.QName(), "::TestByteString", "Interface has the right QName")
@@ -58,42 +59,42 @@ def WebIDLTest(parser, harness):
 
     # Can have optional ByteStrings with default values
     try:
         parser.parse("""
             interface OptionalByteString {
               void passByteString(optional ByteString arg = "hello");
               };
         """)
-        results2 = parser.finish();
+        parser.finish()
     except WebIDL.WebIDLError as e:
         harness.ok(False,
                    "Should not have thrown a WebIDL error for ByteString "
                    "default in dictionary. " + str(e))
 
     # Can have a default ByteString value in a dictionary
     try:
         parser.parse("""
         dictionary OptionalByteStringDict {
           ByteString item = "some string";
         };
         """)
-        results3 = parser.finish();
+        parser.finish()
     except WebIDL.WebIDLError as e:
         harness.ok(False,
                    "Should not have thrown a WebIDL error for ByteString "
                    "default in dictionary. " + str(e))
 
     # Don't allow control characters in ByteString literals
     threw = False
     try:
         parser.parse("""
         dictionary OptionalByteStringDict2 {
           ByteString item = "\x03";
         };
         """)
-        results4 = parser.finish()
+        parser.finish()
     except WebIDL.WebIDLError as e:
         threw = True
 
     harness.ok(threw,
                "Should have thrown a WebIDL error for invalid ByteString "
                "default in dictionary")
--- a/dom/bindings/parser/tests/test_callback.py
+++ b/dom/bindings/parser/tests/test_callback.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestCallback {
           attribute CallbackType? listener;
         };
 
         callback CallbackType = boolean (unsigned long arg);
     """)
--- a/dom/bindings/parser/tests/test_callback_interface.py
+++ b/dom/bindings/parser/tests/test_callback_interface.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         callback interface TestCallbackInterface {
           attribute boolean bool;
         };
     """)
 
     results = parser.finish()
@@ -19,33 +17,33 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             interface TestInterface {
             };
             callback interface TestCallbackInterface : TestInterface {
               attribute boolean bool;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow non-callback parent of callback interface")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestInterface : TestCallbackInterface {
             };
             callback interface TestCallbackInterface {
               attribute boolean bool;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow callback parent of non-callback interface")
 
     parser = parser.reset()
     parser.parse("""
         callback interface TestCallbackInterface1 {
           void foo();
@@ -84,11 +82,11 @@ def WebIDLTest(parser, harness):
           void foo();
         };
         callback interface TestCallbackInterface10 : TestCallbackInterface1 {
           void bar();
         };
     """)
     results = parser.finish()
     for (i, iface) in enumerate(results):
-      harness.check(iface.isSingleOperationInterface(), i < 4,
-                    "Interface %s should be a single operation interface" %
-                    iface.identifier.name)
+        harness.check(iface.isSingleOperationInterface(), i < 4,
+                      "Interface %s should be a single operation interface" %
+                      iface.identifier.name)
--- a/dom/bindings/parser/tests/test_cereactions.py
+++ b/dom/bindings/parser/tests/test_cereactions.py
@@ -2,132 +2,133 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface Foo {
               [CEReactions(DOMString a)] void foo(boolean arg2);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown for [CEReactions] with an argument")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Foo {
               [CEReactions(DOMString b)] readonly attribute boolean bar;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown for [CEReactions] with an argument")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Foo {
               [CEReactions] attribute boolean bar;
             };
         """)
 
-        results = parser.finish()
+        parser.finish()
     except Exception, e:
-        harness.ok(False, "Shouldn't have thrown for [CEReactions] used on writable attribute. %s" % e)
+        harness.ok(
+            False, "Shouldn't have thrown for [CEReactions] used on writable attribute. %s" % e)
         threw = True
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Foo {
               [CEReactions] void foo(boolean arg2);
             };
         """)
 
-        results = parser.finish()
+        parser.finish()
     except Exception, e:
-        harness.ok(False, "Shouldn't have thrown for [CEReactions] used on regular operations. %s" % e)
+        harness.ok(
+            False, "Shouldn't have thrown for [CEReactions] used on regular operations. %s" % e)
         threw = True
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Foo {
               [CEReactions] readonly attribute boolean A;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown for [CEReactions] used on a readonly attribute")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [CEReactions]
             interface Foo {
             }
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown for [CEReactions] used on a interface")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface Foo {
             [CEReactions] getter any(DOMString name);
           };
         """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [CEReactions] used on a named getter")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface Foo {
             [CEReactions] legacycaller double compute(double x);
           };
         """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [CEReactions] used on a legacycaller")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface Foo {
             [CEReactions] stringifier DOMString ();
           };
         """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [CEReactions] used on a stringifier")
-
--- a/dom/bindings/parser/tests/test_conditional_dictionary_member.py
+++ b/dom/bindings/parser/tests/test_conditional_dictionary_member.py
@@ -2,17 +2,17 @@ def WebIDLTest(parser, harness):
     parser.parse("""
       dictionary Dict {
         any foo;
         [ChromeOnly] any bar;
       };
     """)
     results = parser.finish()
     harness.check(len(results), 1, "Should have a dictionary")
-    members = results[0].members;
+    members = results[0].members
     harness.check(len(members), 2, "Should have two members")
     # Note that members are ordered lexicographically, so "bar" comes
     # before "foo".
     harness.ok(members[0].getExtendedAttribute("ChromeOnly"),
                "First member is not ChromeOnly")
     harness.ok(not members[1].getExtendedAttribute("ChromeOnly"),
                "Second member is ChromeOnly")
 
@@ -28,83 +28,83 @@ def WebIDLTest(parser, harness):
       };
     """)
     results = parser.finish()
     harness.check(len(results), 2, "Should have a dictionary and an interface")
 
     parser = parser.reset()
     exception = None
     try:
-      parser.parse("""
+        parser.parse("""
         dictionary Dict {
           any foo;
           [ChromeOnly] any bar;
         };
 
         interface Iface {
           [Constant, Cached] readonly attribute Dict dict;
         };
       """)
-      results = parser.finish()
+        results = parser.finish()
     except Exception, exception:
         pass
 
     harness.ok(exception, "Should have thrown.")
     harness.check(exception.message,
                   "[Cached] and [StoreInSlot] must not be used on an attribute "
                   "whose type contains a [ChromeOnly] dictionary member",
                   "Should have thrown the right exception")
 
     parser = parser.reset()
     exception = None
     try:
-      parser.parse("""
+        parser.parse("""
         dictionary ParentDict {
           [ChromeOnly] any bar;
         };
 
         dictionary Dict : ParentDict {
           any foo;
         };
 
         interface Iface {
           [Constant, Cached] readonly attribute Dict dict;
         };
       """)
-      results = parser.finish()
+        results = parser.finish()
     except Exception, exception:
         pass
 
     harness.ok(exception, "Should have thrown (2).")
     harness.check(exception.message,
                   "[Cached] and [StoreInSlot] must not be used on an attribute "
                   "whose type contains a [ChromeOnly] dictionary member",
                   "Should have thrown the right exception (2)")
 
     parser = parser.reset()
     exception = None
     try:
-      parser.parse("""
+        parser.parse("""
         dictionary GrandParentDict {
           [ChromeOnly] any baz;
         };
 
         dictionary ParentDict : GrandParentDict {
           any bar;
         };
 
         dictionary Dict : ParentDict {
           any foo;
         };
 
         interface Iface {
           [Constant, Cached] readonly attribute Dict dict;
         };
       """)
-      results = parser.finish()
+        results = parser.finish()
     except Exception, exception:
         pass
 
     harness.ok(exception, "Should have thrown (3).")
     harness.check(exception.message,
                   "[Cached] and [StoreInSlot] must not be used on an attribute "
                   "whose type contains a [ChromeOnly] dictionary member",
                   "Should have thrown the right exception (3)")
--- a/dom/bindings/parser/tests/test_const.py
+++ b/dom/bindings/parser/tests/test_const.py
@@ -20,16 +20,17 @@ expected = [
     ("::TestConsts::ufl", "ufl", "UnrestrictedFloat", 0.2),
     ("::TestConsts::udb", "udb", "UnrestrictedDouble", 0.2),
     ("::TestConsts::fli", "fli", "Float", 2),
     ("::TestConsts::dbi", "dbi", "Double", 2),
     ("::TestConsts::ufli", "ufli", "UnrestrictedFloat", 2),
     ("::TestConsts::udbi", "udbi", "UnrestrictedDouble", 2),
 ]
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestConsts {
           const byte zero = 0;
           const byte b = -1;
           const octet o = 2;
           const short s = -3;
           const unsigned short us = 0x4;
@@ -72,9 +73,8 @@ def WebIDLTest(parser, harness):
         harness.ok(not const.isMethod(), "Const is not a method")
         harness.check(const.identifier.QName(), QName, "Const has the right QName")
         harness.check(const.identifier.name, name, "Const has the right name")
         harness.check(str(const.type), type, "Const has the right type")
         harness.ok(const.type.isPrimitive(), "All consts should be primitive")
         harness.check(str(const.value.type), str(const.type),
                       "Const's value has the same type as the type")
         harness.check(const.value.value, value, "Const value has the right value.")
-
--- a/dom/bindings/parser/tests/test_constructor.py
+++ b/dom/bindings/parser/tests/test_constructor.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     def checkArgument(argument, QName, name, type, optional, variadic):
         harness.ok(isinstance(argument, WebIDL.IDLArgument),
                    "Should be an IDLArgument")
         harness.check(argument.identifier.QName(), QName, "Argument has the right QName")
         harness.check(argument.identifier.name, name, "Argument has the right name")
         harness.check(str(argument.type), type, "Argument has the right return type")
         harness.check(argument.optional, optional, "Argument has the right optional value")
@@ -20,21 +21,26 @@ def WebIDLTest(parser, harness):
         harness.ok(not method.isAttr(), "Method is not an attr")
         harness.ok(not method.isConst(), "Method is not a const")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         harness.check(method.isStatic(), static, "Method has the correct static value")
         harness.check(method.isGetter(), getter, "Method has the correct getter value")
         harness.check(method.isSetter(), setter, "Method has the correct setter value")
         harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
-        harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
-        harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
-        harness.check(method.getExtendedAttribute("ChromeOnly") is not None, chromeOnly, "Method has the correct value for ChromeOnly")
-        harness.check(method.isHTMLConstructor(), htmlConstructor, "Method has the correct htmlConstructor value")
-        harness.check(len(method.signatures()), len(signatures), "Method has the correct number of signatures")
+        harness.check(method.isLegacycaller(), legacycaller,
+                      "Method has the correct legacycaller value")
+        harness.check(method.isStringifier(), stringifier,
+                      "Method has the correct stringifier value")
+        harness.check(method.getExtendedAttribute("ChromeOnly") is not None,
+                      chromeOnly, "Method has the correct value for ChromeOnly")
+        harness.check(method.isHTMLConstructor(), htmlConstructor,
+                      "Method has the correct htmlConstructor value")
+        harness.check(len(method.signatures()), len(signatures),
+                      "Method has the correct number of signatures")
 
         sigpairs = zip(method.signatures(), signatures)
         for (gotSignature, expectedSignature) in sigpairs:
             (gotRetType, gotArgs) = gotSignature
             (expectedRetType, expectedArgs) = expectedSignature
 
             harness.check(str(gotRetType), expectedRetType,
                           "Method has the expected return type.")
@@ -65,23 +71,26 @@ def WebIDLTest(parser, harness):
     harness.ok(isinstance(results[2], WebIDL.IDLInterface),
                "Should be an IDLInterface")
 
     checkMethod(results[0].ctor(), "::TestConstructorNoArgs::constructor",
                 "constructor", [("TestConstructorNoArgs (Wrapper)", [])])
     checkMethod(results[1].ctor(), "::TestConstructorWithArgs::constructor",
                 "constructor",
                 [("TestConstructorWithArgs (Wrapper)",
-                 [("::TestConstructorWithArgs::constructor::name", "name", "String", False, False)])])
+                  [("::TestConstructorWithArgs::constructor::name", "name", "String",
+                    False, False)])])
     checkMethod(results[2].ctor(), "::TestConstructorOverloads::constructor",
                 "constructor",
                 [("TestConstructorOverloads (Wrapper)",
-                 [("::TestConstructorOverloads::constructor::foo", "foo", "Object", False, False)]),
+                  [("::TestConstructorOverloads::constructor::foo", "foo", "Object",
+                    False, False)]),
                  ("TestConstructorOverloads (Wrapper)",
-                 [("::TestConstructorOverloads::constructor::bar", "bar", "Boolean", False, False)])])
+                  [("::TestConstructorOverloads::constructor::bar", "bar", "Boolean",
+                    False, False)])])
 
     parser = parser.reset()
     parser.parse("""
         [ChromeConstructor()]
         interface TestChromeConstructor {
         };
     """)
     results = parser.finish()
@@ -113,160 +122,160 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
         [Constructor(),
          ChromeConstructor(DOMString a)]
         interface TestChromeConstructor {
         };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a Constructor and a ChromeConstructor")
 
     # Test HTMLConstructor with argument
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor(DOMString a)]
             interface TestHTMLConstructorWithArgs {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "HTMLConstructor should take no argument")
 
     # Test HTMLConstructor on a callback interface
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor]
             callback interface TestHTMLConstructorOnCallbackInterface {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "HTMLConstructor can't be used on a callback interface")
 
     # Test HTMLConstructor and Constructor
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [Constructor,
              HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a Constructor and a HTMLConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor,
              Constructor]
             interface TestHTMLConstructorAndConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a Constructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor,
              Constructor(DOMString a)]
             interface TestHTMLConstructorAndConstructor {
             };
         """)
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a Constructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [Constructor(DOMString a),
              HTMLConstructor]
             interface TestHTMLConstructorAndConstructor {
             };
         """)
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a Constructor")
 
     # Test HTMLConstructor and ChromeConstructor
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [ChromeConstructor,
              HTMLConstructor]
             interface TestHTMLConstructorAndChromeConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a ChromeConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor,
              ChromeConstructor]
             interface TestHTMLConstructorAndChromeConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a ChromeConstructor")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [ChromeConstructor(DOMString a),
              HTMLConstructor]
             interface TestHTMLConstructorAndChromeConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor,
              ChromeConstructor(DOMString a)]
             interface TestHTMLConstructorAndChromeConstructor {
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Can't have both a HTMLConstructor and a ChromeConstructor")
--- a/dom/bindings/parser/tests/test_constructor_no_interface_object.py
+++ b/dom/bindings/parser/tests/test_constructor_no_interface_object.py
@@ -2,32 +2,32 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             [Constructor, NoInterfaceObject]
             interface TestConstructorNoInterfaceObject {
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             [NoInterfaceObject, Constructor]
             interface TestConstructorNoInterfaceObject {
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
 
     parser.parse("""
         [NoInterfaceObject, NamedConstructor=FooBar]
@@ -41,29 +41,29 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             [NoInterfaceObject, HTMLConstructor]
             interface TestHTMLConstructorNoInterfaceObject {
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
 
     threw = False
     try:
         parser.parse("""
             [HTMLConstructor, NoInterfaceObject]
             interface TestHTMLConstructorNoInterfaceObject {
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_deduplicate.py
+++ b/dom/bindings/parser/tests/test_deduplicate.py
@@ -1,15 +1,13 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface Foo;
         interface Bar;
         interface Foo;
-        """);
+        """)
 
     results = parser.finish()
 
     # There should be no duplicate interfaces in the result.
     expectedNames = sorted(['Foo', 'Bar'])
     actualNames = sorted(map(lambda iface: iface.identifier.name, results))
     harness.check(actualNames, expectedNames, "Parser shouldn't output duplicate names.")
--- a/dom/bindings/parser/tests/test_dictionary.py
+++ b/dom/bindings/parser/tests/test_dictionary.py
@@ -6,18 +6,18 @@ def WebIDLTest(parser, harness):
       };
       dictionary Dict1 {
         long parent;
         double otherParent;
       };
     """)
     results = parser.finish()
 
-    dict1 = results[1];
-    dict2 = results[0];
+    dict1 = results[1]
+    dict2 = results[0]
 
     harness.check(len(dict1.members), 2, "Dict1 has two members")
     harness.check(len(dict2.members), 2, "Dict2 has four members")
 
     harness.check(dict1.members[0].identifier.name, "otherParent",
                   "'o' comes before 'p'")
     harness.check(dict1.members[1].identifier.name, "parent",
                   "'o' really comes before 'p'")
@@ -32,17 +32,17 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
           dictionary Dict {
             long prop = 5;
             long prop;
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow name duplication in a dictionary")
 
     # Now reset our parser again
     parser = parser.reset()
     threw = False
     try:
@@ -53,144 +53,144 @@ def WebIDLTest(parser, harness):
           dictionary Dict2 : Dict3 {
             long prop2;
           };
           dictionary Dict3 {
             double prop;
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow name duplication in a dictionary and "
                "its ancestor")
 
     # More reset
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface Iface {};
           dictionary Dict : Iface {
             long prop;
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow non-dictionary parents for dictionaries")
 
     # Even more reset
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A : B {};
             dictionary B : A {};
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow cycles in dictionary inheritance chains")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
               [TreatNullAs=EmptyString] DOMString foo;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
-    harness.ok(threw, "Should not allow [TreatNullAs] on dictionary members");
+    harness.ok(threw, "Should not allow [TreatNullAs] on dictionary members")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(A arg);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Trailing dictionary arg must be optional")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo((A or DOMString) arg);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Trailing union arg containing a dictionary must be optional")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(A arg1, optional long arg2);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Dictionary arg followed by optional arg must be optional")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(A arg1, optional long arg2, long arg3);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(not threw,
                "Dictionary arg followed by non-optional arg doesn't have to be optional")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo((A or DOMString) arg1, optional long arg2);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Union arg containing dictionary followed by optional arg must "
                "be optional")
 
     parser = parser.reset()
     parser.parse("""
@@ -209,65 +209,65 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(optional A? arg1);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Dictionary arg must not be nullable")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(optional (A or long)? arg1);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Dictionary arg must not be in a nullable union")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(optional (A or long?) arg1);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Dictionary must not be in a union with a nullable type")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
             };
             interface X {
               void doFoo(optional (long? or A) arg1);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "A nullable type must not be in a union with a dictionary")
 
     parser = parser.reset()
     parser.parse("""
         dictionary A {
         };
@@ -304,17 +304,17 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               Foo foo;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
@@ -330,77 +330,77 @@ def WebIDLTest(parser, harness):
               long a;
             };
 
             dictionary Foo {
               Foo1 b;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a Dictionary that "
                       "inherits from its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               (Foo or DOMString)[]? b;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a Nullable type "
                       "whose inner type includes its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               (DOMString or Foo) b;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a Union type, one of "
                       "whose member types includes its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               sequence<sequence<sequence<Foo>>> c;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a Sequence type "
                       "whose element type includes its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               (DOMString or Foo)[] d;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be an Array type "
                       "whose element type includes its Dictionary.")
 
     parser = parser.reset()
     threw = False
     try:
@@ -417,41 +417,41 @@ def WebIDLTest(parser, harness):
               short c;
             };
 
             dictionary Foo1 : Foo2 {
               long a;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a Dictionary, one of whose "
                       "members or inherited members has a type that includes "
                       "its Dictionary.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
             };
 
             dictionary Bar {
               Foo? d;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Member type must not be a nullable dictionary")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
         dictionary Foo {
           unrestricted float  urFloat = 0;
           unrestricted float  urFloat2 = 1.1;
           unrestricted float  urFloat3 = -1.1;
           unrestricted float? urFloat4 = null;
           unrestricted float  infUrFloat = Infinity;
           unrestricted float  negativeInfUrFloat = -Infinity;
@@ -464,92 +464,91 @@ def WebIDLTest(parser, harness):
           unrestricted double  infUrDouble = Infinity;
           unrestricted double  negativeInfUrDouble = -Infinity;
           unrestricted double  nanUrDouble = NaN;
         };
     """)
     results = parser.finish()
     harness.ok(True, "Parsing default values for unrestricted types succeeded.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               double f = Infinity;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to Infinity")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               double f = -Infinity;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to -Infinity")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               double f = NaN;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to NaN")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               float f = Infinity;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to Infinity")
 
-
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               float f = -Infinity;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to -Infinity")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Foo {
               float f = NaN;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Only unrestricted values can be initialized to NaN")
--- a/dom/bindings/parser/tests/test_distinguishability.py
+++ b/dom/bindings/parser/tests/test_distinguishability.py
@@ -1,11 +1,12 @@
 def firstArgType(method):
     return method.signatures()[0][1][0].type
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
       dictionary Dict {
       };
       callback interface Foo {
       };
       interface Bar {
         // Bit of a pain to get things that have dictionary types
@@ -22,31 +23,31 @@ def WebIDLTest(parser, harness):
     dictMethod = iface.members[0]
     ifaceMethod = iface.members[1]
     nullableUnionMethod = iface.members[2]
     nullableIfaceMethod = iface.members[3]
 
     dictType = firstArgType(dictMethod)
     ifaceType = firstArgType(ifaceMethod)
 
-    harness.ok(dictType.isDictionary(), "Should have dictionary type");
-    harness.ok(ifaceType.isInterface(), "Should have interface type");
-    harness.ok(ifaceType.isCallbackInterface(), "Should have callback interface type");
+    harness.ok(dictType.isDictionary(), "Should have dictionary type")
+    harness.ok(ifaceType.isInterface(), "Should have interface type")
+    harness.ok(ifaceType.isCallbackInterface(), "Should have callback interface type")
 
     harness.ok(not dictType.isDistinguishableFrom(ifaceType),
                "Dictionary not distinguishable from callback interface")
     harness.ok(not ifaceType.isDistinguishableFrom(dictType),
                "Callback interface not distinguishable from dictionary")
 
     nullableUnionType = firstArgType(nullableUnionMethod)
     nullableIfaceType = firstArgType(nullableIfaceMethod)
 
-    harness.ok(nullableUnionType.isUnion(), "Should have union type");
-    harness.ok(nullableIfaceType.isInterface(), "Should have interface type");
-    harness.ok(nullableIfaceType.nullable(), "Should have nullable type");
+    harness.ok(nullableUnionType.isUnion(), "Should have union type")
+    harness.ok(nullableIfaceType.isInterface(), "Should have interface type")
+    harness.ok(nullableIfaceType.nullable(), "Should have nullable type")
 
     harness.ok(not nullableUnionType.isDistinguishableFrom(nullableIfaceType),
                "Nullable type not distinguishable from union with nullable "
                "member type")
     harness.ok(not nullableIfaceType.isDistinguishableFrom(nullableUnionType),
                "Union with nullable member type not distinguishable from "
                "nullable type")
 
@@ -119,17 +120,17 @@ def WebIDLTest(parser, harness):
           interface TestIface {
             void method(long arg1, TestIface arg2);
             void method(long arg1, long arg2);
             void method(any arg1,  Dummy arg2);
             void method(DOMString arg1, DOMString arg2, DOMString arg3);
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should throw when args before the distinguishing arg are not "
                "all the same type")
 
     parser = parser.reset()
     threw = False
@@ -139,78 +140,78 @@ def WebIDLTest(parser, harness):
           interface TestIface {
             void method(long arg1, TestIface arg2);
             void method(long arg1, long arg2);
             void method(any arg1,  DOMString arg2);
             void method(DOMString arg1, DOMString arg2, DOMString arg3);
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should throw when there is no distinguishing index")
 
     # Now let's test our whole distinguishability table
-    argTypes = [ "long", "short", "long?", "short?", "boolean",
-                 "boolean?", "DOMString", "ByteString", "Enum", "Enum2",
-                 "Interface", "Interface?",
-                 "AncestorInterface", "UnrelatedInterface",
-                 "ImplementedInterface", "CallbackInterface",
-                 "CallbackInterface?", "CallbackInterface2",
-                 "object", "Callback", "Callback2", "optional Dict",
-                 "optional Dict2", "sequence<long>", "sequence<short>",
-                 "record<DOMString, object>",
-                 "record<USVString, Dict>",
-                 "record<ByteString, long>",
-                 "Date", "Date?", "any",
-                 "Promise<any>", "Promise<any>?",
-                 "USVString", "ArrayBuffer", "ArrayBufferView", "SharedArrayBuffer",
-                 "Uint8Array", "Uint16Array",
-                 "(long or Callback)", "optional (long or Dict)",
-    ]
+    argTypes = ["long", "short", "long?", "short?", "boolean",
+                "boolean?", "DOMString", "ByteString", "Enum", "Enum2",
+                "Interface", "Interface?",
+                "AncestorInterface", "UnrelatedInterface",
+                "ImplementedInterface", "CallbackInterface",
+                "CallbackInterface?", "CallbackInterface2",
+                "object", "Callback", "Callback2", "optional Dict",
+                "optional Dict2", "sequence<long>", "sequence<short>",
+                "record<DOMString, object>",
+                "record<USVString, Dict>",
+                "record<ByteString, long>",
+                "Date", "Date?", "any",
+                "Promise<any>", "Promise<any>?",
+                "USVString", "ArrayBuffer", "ArrayBufferView", "SharedArrayBuffer",
+                "Uint8Array", "Uint16Array",
+                "(long or Callback)", "optional (long or Dict)",
+                ]
     # When we can parse Date, we need to add it here.
     # XXXbz we can, and should really do that...
 
     # Try to categorize things a bit to keep list lengths down
     def allBut(list1, list2):
         return [a for a in list1 if a not in list2 and
                 (a != "any" and a != "Promise<any>" and a != "Promise<any>?")]
-    unions = [ "(long or Callback)", "optional (long or Dict)" ]
-    numerics = [ "long", "short", "long?", "short?" ]
-    booleans = [ "boolean", "boolean?" ]
+    unions = ["(long or Callback)", "optional (long or Dict)"]
+    numerics = ["long", "short", "long?", "short?"]
+    booleans = ["boolean", "boolean?"]
     primitives = numerics + booleans
     nonNumerics = allBut(argTypes, numerics + unions)
     nonBooleans = allBut(argTypes, booleans)
-    strings = [ "DOMString", "ByteString", "Enum", "Enum2", "USVString" ]
+    strings = ["DOMString", "ByteString", "Enum", "Enum2", "USVString"]
     nonStrings = allBut(argTypes, strings)
     nonObjects = primitives + strings
-    objects = allBut(argTypes, nonObjects )
     bufferSourceTypes = ["ArrayBuffer", "ArrayBufferView", "Uint8Array", "Uint16Array"]
     sharedBufferSourceTypes = ["SharedArrayBuffer"]
-    interfaces = [ "Interface", "Interface?", "AncestorInterface",
-                   "UnrelatedInterface", "ImplementedInterface" ] + bufferSourceTypes + sharedBufferSourceTypes
+    interfaces = (["Interface", "Interface?", "AncestorInterface",
+                  "UnrelatedInterface", "ImplementedInterface"] +
+                  bufferSourceTypes + sharedBufferSourceTypes)
     nullables = (["long?", "short?", "boolean?", "Interface?",
                   "CallbackInterface?", "optional Dict", "optional Dict2",
                   "Date?", "any", "Promise<any>?"] +
-                 allBut(unions, [ "(long or Callback)" ]))
-    dates = [ "Date", "Date?" ]
-    sequences = [ "sequence<long>", "sequence<short>" ]
+                 allBut(unions, ["(long or Callback)"]))
+    dates = ["Date", "Date?"]
+    sequences = ["sequence<long>", "sequence<short>"]
     nonUserObjects = nonObjects + interfaces + dates + sequences
     otherObjects = allBut(argTypes, nonUserObjects + ["object"])
     notRelatedInterfaces = (nonObjects + ["UnrelatedInterface"] +
-                            otherObjects + dates + sequences + bufferSourceTypes + sharedBufferSourceTypes)
-    records = [ "record<DOMString, object>", "record<USVString, Dict>",
-                "record<ByteString, long>" ]
+                            otherObjects + dates + sequences + bufferSourceTypes +
+                            sharedBufferSourceTypes)
 
     # Build a representation of the distinguishability table as a dict
     # of dicts, holding True values where needed, holes elsewhere.
-    data = dict();
+    data = dict()
     for type in argTypes:
         data[type] = dict()
+
     def setDistinguishable(type, types):
         for other in types:
             data[type][other] = True
 
     setDistinguishable("long", nonNumerics)
     setDistinguishable("short", nonNumerics)
     setDistinguishable("long?", allBut(nonNumerics, nullables))
     setDistinguishable("short?", allBut(nonNumerics, nullables))
@@ -243,19 +244,21 @@ def WebIDLTest(parser, harness):
     setDistinguishable("record<USVString, Dict>", nonUserObjects)
     setDistinguishable("record<ByteString, long>", nonUserObjects)
     setDistinguishable("Date", allBut(argTypes, dates + ["object"]))
     setDistinguishable("Date?", allBut(argTypes, dates + nullables + ["object"]))
     setDistinguishable("any", [])
     setDistinguishable("Promise<any>", [])
     setDistinguishable("Promise<any>?", [])
     setDistinguishable("ArrayBuffer", allBut(argTypes, ["ArrayBuffer", "object"]))
-    setDistinguishable("ArrayBufferView", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "Uint16Array", "object"]))
+    setDistinguishable("ArrayBufferView", allBut(
+        argTypes, ["ArrayBufferView", "Uint8Array", "Uint16Array", "object"]))
     setDistinguishable("Uint8Array", allBut(argTypes, ["ArrayBufferView", "Uint8Array", "object"]))
-    setDistinguishable("Uint16Array", allBut(argTypes, ["ArrayBufferView", "Uint16Array", "object"]))
+    setDistinguishable("Uint16Array", allBut(
+        argTypes, ["ArrayBufferView", "Uint16Array", "object"]))
     setDistinguishable("SharedArrayBuffer", allBut(argTypes, ["SharedArrayBuffer", "object"]))
     setDistinguishable("(long or Callback)",
                        allBut(nonUserObjects, numerics))
     setDistinguishable("optional (long or Dict)",
                        allBut(nonUserObjects, numerics + nullables))
 
     def areDistinguishable(type1, type2):
         return data[type1].get(type2, False)
@@ -281,24 +284,26 @@ def WebIDLTest(parser, harness):
         methodTemplate = """
             void myMethod(%s arg);"""
         methods = (methodTemplate % type1) + (methodTemplate % type2)
         idl = idlTemplate % methods
         parser = parser.reset()
         threw = False
         try:
             parser.parse(idl)
-            results = parser.finish()
-        except:
+            parser.finish()
+        except Exception:
             threw = True
 
         if areDistinguishable(type1, type2):
             harness.ok(not threw,
-                       "Should not throw for '%s' and '%s' because they are distinguishable" % (type1, type2))
+                       "Should not throw for '%s' and '%s' because they are distinguishable" %
+                       (type1, type2))
         else:
             harness.ok(threw,
-                       "Should throw for '%s' and '%s' because they are not distinguishable" % (type1, type2))
+                       "Should throw for '%s' and '%s' because they are not distinguishable" %
+                       (type1, type2))
 
     # Enumerate over everything in both orders, since order matters in
     # terms of our implementation of distinguishability checks
     for type1 in argTypes:
         for type2 in argTypes:
             checkDistinguishability(parser, type1, type2)
--- a/dom/bindings/parser/tests/test_double_null.py
+++ b/dom/bindings/parser/tests/test_double_null.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface DoubleNull {
               attribute byte?? foo;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_duplicate_qualifiers.py
+++ b/dom/bindings/parser/tests/test_duplicate_qualifiers.py
@@ -2,55 +2,55 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface DuplicateQualifiers1 {
               getter getter byte foo(unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface DuplicateQualifiers2 {
               setter setter byte foo(unsigned long index, byte value);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface DuplicateQualifiers4 {
               deleter deleter byte foo(unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface DuplicateQualifiers5 {
               getter deleter getter byte foo(unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_empty_enum.py
+++ b/dom/bindings/parser/tests/test_empty_enum.py
@@ -1,14 +1,12 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             enum TestEmptyEnum {
             };
         """)
 
         harness.ok(False, "Should have thrown!")
-    except:
+    except Exception:
         harness.ok(True, "Parsing TestEmptyEnum enum should fail")
 
-    results = parser.finish()
+    parser.finish()
--- a/dom/bindings/parser/tests/test_empty_sequence_default_value.py
+++ b/dom/bindings/parser/tests/test_empty_sequence_default_value.py
@@ -1,45 +1,45 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface X {
               const sequence<long> foo = [];
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Constant cannot have [] as a default value")
 
     parser = parser.reset()
 
     parser.parse("""
         interface X {
           void foo(optional sequence<long> arg = []);
         };
     """)
-    results = parser.finish();
+    results = parser.finish()
 
     harness.ok(isinstance(
         results[0].members[0].signatures()[0][1][0].defaultValue,
         WebIDL.IDLEmptySequenceValue),
                "Should have IDLEmptySequenceValue as default value of argument")
 
     parser = parser.reset()
 
     parser.parse("""
         dictionary X {
           sequence<long> foo = [];
         };
     """)
-    results = parser.finish();
+    results = parser.finish()
 
     harness.ok(isinstance(results[0].members[0].defaultValue,
                           WebIDL.IDLEmptySequenceValue),
                "Should have IDLEmptySequenceValue as default value of "
                "dictionary member")
-
--- a/dom/bindings/parser/tests/test_enum.py
+++ b/dom/bindings/parser/tests/test_enum.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         enum TestEnum {
           "",
           "foo",
           "bar"
         };
 
@@ -70,17 +71,17 @@ def WebIDLTest(parser, harness):
             "b",
             "c"
           };
           interface TestInterface {
             void foo(optional Enum e = "d");
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow a bogus default value for an enum")
 
     # Now reset our parser
     parser = parser.reset()
     parser.parse("""
       enum Enum {
--- a/dom/bindings/parser/tests/test_enum_duplicate_values.py
+++ b/dom/bindings/parser/tests/test_enum_duplicate_values.py
@@ -1,13 +1,11 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             enum TestEnumDuplicateValue {
               "",
               ""
             };
         """)
         harness.ok(False, "Should have thrown!")
-    except:
+    except Exception:
         harness.ok(True, "Enum TestEnumDuplicateValue should throw")
--- a/dom/bindings/parser/tests/test_error_colno.py
+++ b/dom/bindings/parser/tests/test_error_colno.py
@@ -1,18 +1,19 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     # Check that error messages put the '^' in the right place.
 
     threw = False
     input = 'interface ?'
     try:
         parser.parse(input)
-        results = parser.finish()
+        parser.finish()
     except WebIDL.WebIDLError, e:
         threw = True
         lines = str(e).split('\n')
 
         harness.check(len(lines), 3, 'Expected number of lines in error message')
         harness.check(lines[1], input, 'Second line shows error')
         harness.check(lines[2], ' ' * (len(input) - 1) + '^',
                       'Correct column pointer in error message')
--- a/dom/bindings/parser/tests/test_error_lineno.py
+++ b/dom/bindings/parser/tests/test_error_lineno.py
@@ -1,28 +1,30 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     # Check that error messages put the '^' in the right place.
 
     threw = False
     input = """\
 // This is a comment.
 interface Foo {
 };
 
 /* This is also a comment. */
 interface ?"""
     try:
         parser.parse(input)
-        results = parser.finish()
+        parser.finish()
     except WebIDL.WebIDLError, e:
         threw = True
         lines = str(e).split('\n')
 
         harness.check(len(lines), 3, 'Expected number of lines in error message')
-        harness.ok(lines[0].endswith('line 6:10'), 'First line of error should end with "line 6:10", but was "%s".' % lines[0])
-        harness.check(lines[1], 'interface ?', 'Second line of error message is the line which caused the error.')
+        harness.ok(lines[0].endswith('line 6:10'),
+                   'First line of error should end with "line 6:10", but was "%s".' % lines[0])
+        harness.check(lines[1], 'interface ?',
+                      'Second line of error message is the line which caused the error.')
         harness.check(lines[2], ' ' * (len('interface ?') - 1) + '^',
                       'Correct column pointer in error message.')
 
     harness.ok(threw, "Should have thrown.")
-
--- a/dom/bindings/parser/tests/test_exposed_extended_attribute.py
+++ b/dom/bindings/parser/tests/test_exposed_extended_attribute.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
       [PrimaryGlobal] interface Foo {};
       [Global=(Bar1,Bar2)] interface Bar {};
       [Global=Baz2] interface Baz {};
 
       [Exposed=(Foo,Bar1)]
       interface Iface {
@@ -17,20 +18,20 @@ def WebIDLTest(parser, harness):
       [Exposed=Foo]
       partial interface Iface {
         void method2();
       };
     """)
 
     results = parser.finish()
 
-    harness.check(len(results), 5, "Should know about five things");
+    harness.check(len(results), 5, "Should know about five things")
     iface = results[3]
     harness.ok(isinstance(iface, WebIDL.IDLInterface),
-               "Should have an interface here");
+               "Should have an interface here")
     members = iface.members
     harness.check(len(members), 3, "Should have three members")
 
     harness.ok(members[0].exposureSet == set(["Foo", "Bar"]),
                "method1 should have the right exposure set")
     harness.ok(members[0]._exposureGlobalNames == set(["Foo", "Bar1"]),
                "method1 should have the right exposure global names")
 
@@ -56,20 +57,20 @@ def WebIDLTest(parser, harness):
       [Global=Baz2] interface Baz {};
 
       interface Iface2 {
         void method3();
       };
     """)
     results = parser.finish()
 
-    harness.check(len(results), 4, "Should know about four things");
+    harness.check(len(results), 4, "Should know about four things")
     iface = results[3]
     harness.ok(isinstance(iface, WebIDL.IDLInterface),
-               "Should have an interface here");
+               "Should have an interface here")
     members = iface.members
     harness.check(len(members), 1, "Should have one member")
 
     harness.ok(members[0].exposureSet == set(["Foo"]),
                "method3 should have the right exposure set")
     harness.ok(members[0]._exposureGlobalNames == set(["Foo"]),
                "method3 should have the right exposure global names")
 
@@ -92,20 +93,20 @@ def WebIDLTest(parser, harness):
       [Exposed=(Foo,Bar1)]
       interface Mixin {
         void method5();
       };
 
       Iface3 implements Mixin;
     """)
     results = parser.finish()
-    harness.check(len(results), 6, "Should know about six things");
+    harness.check(len(results), 6, "Should know about six things")
     iface = results[3]
     harness.ok(isinstance(iface, WebIDL.IDLInterface),
-               "Should have an interface here");
+               "Should have an interface here")
     members = iface.members
     harness.check(len(members), 2, "Should have two members")
 
     harness.ok(members[0].exposureSet == set(["Foo"]),
                "method4 should have the right exposure set")
     harness.ok(members[0]._exposureGlobalNames == set(["Foo"]),
                "method4 should have the right exposure global names")
 
@@ -119,65 +120,65 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             [Exposed=Foo]
             interface Bar {
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on invalid Exposed value on interface.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Bar {
               [Exposed=Foo]
               readonly attribute bool attr;
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on invalid Exposed value on attribute.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Bar {
               [Exposed=Foo]
               void operation();
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on invalid Exposed value on operation.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Bar {
               [Exposed=Foo]
               const long constant = 5;
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on invalid Exposed value on constant.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
@@ -187,17 +188,17 @@ def WebIDLTest(parser, harness):
             [Exposed=Foo]
             interface Baz {
               [Exposed=Bar]
               void method();
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on member exposed where its interface is not.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
@@ -211,12 +212,12 @@ def WebIDLTest(parser, harness):
 
             [Exposed=Bar]
             interface Mixin {};
 
             Baz implements Mixin;
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on LHS of implements being exposed where RHS is not.")
--- a/dom/bindings/parser/tests/test_extended_attributes.py
+++ b/dom/bindings/parser/tests/test_extended_attributes.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         [NoInterfaceObject]
         interface TestExtendedAttr {
           [Unforgeable] readonly attribute byte b;
         };
     """)
 
@@ -35,17 +33,17 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface TestLenientThis2 {
               [LenientThis=something] attribute byte b;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "[LenientThis] must take no arguments")
 
     parser = parser.reset()
     parser.parse("""
         interface TestClamp {
           void testClamp([Clamp] long foo);
@@ -65,17 +63,17 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface TestClamp2 {
               void testClamp([Clamp=something] long foo);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "[Clamp] must take no arguments")
 
     parser = parser.reset()
     parser.parse("""
         interface TestEnforceRange {
           void testEnforceRange([EnforceRange] long foo);
@@ -95,13 +93,12 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface TestEnforceRange2 {
               void testEnforceRange([EnforceRange=something] long foo);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "[EnforceRange] must take no arguments")
-    
--- a/dom/bindings/parser/tests/test_float_types.py
+++ b/dom/bindings/parser/tests/test_float_types.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         typedef float myFloat;
         typedef unrestricted float myUnrestrictedFloat;
         interface FloatTypes {
           attribute float f;
           attribute unrestricted float uf;
           attribute double d;
@@ -63,63 +64,63 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface FloatTypes {
               [LenientFloat]
               long m(float arg);
             };
         """)
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "[LenientFloat] only allowed on void methods")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface FloatTypes {
               [LenientFloat]
               void m(unrestricted float arg);
             };
         """)
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "[LenientFloat] only allowed on methods with unrestricted float args")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface FloatTypes {
               [LenientFloat]
               void m(sequence<unrestricted float> arg);
             };
         """)
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "[LenientFloat] only allowed on methods with unrestricted float args (2)")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface FloatTypes {
               [LenientFloat]
               void m((unrestricted float or FloatTypes) arg);
             };
         """)
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "[LenientFloat] only allowed on methods with unrestricted float args (3)")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface FloatTypes {
               [LenientFloat]
               readonly attribute float foo;
             };
         """)
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "[LenientFloat] only allowed on writable attributes")
--- a/dom/bindings/parser/tests/test_forward_decl.py
+++ b/dom/bindings/parser/tests/test_forward_decl.py
@@ -1,15 +1,13 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface ForwardDeclared;
         interface ForwardDeclared;
 
         interface TestForwardDecl {
           attribute ForwardDeclared foo;
         };
     """)
 
-    results = parser.finish()
+    parser.finish()
 
     harness.ok(True, "TestForwardDeclared interface parsed without error.")
--- a/dom/bindings/parser/tests/test_global_extended_attr.py
+++ b/dom/bindings/parser/tests/test_global_extended_attr.py
@@ -20,17 +20,17 @@ def WebIDLTest(parser, harness):
         parser.parse("""
           [Global]
           interface Foo {
             getter any(DOMString name);
             setter void(DOMString name, any arg);
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [Global] used on an interface with a "
                "named setter")
 
     parser = parser.reset()
     threw = False
@@ -38,33 +38,33 @@ def WebIDLTest(parser, harness):
         parser.parse("""
           [Global]
           interface Foo {
             getter any(DOMString name);
             deleter void(DOMString name);
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [Global] used on an interface with a "
                "named deleter")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           [Global, OverrideBuiltins]
           interface Foo {
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [Global] used on an interface with a "
                "[OverrideBuiltins]")
 
     parser = parser.reset()
     threw = False
@@ -73,17 +73,17 @@ def WebIDLTest(parser, harness):
           [Global]
           interface Foo : Bar {
           };
           [OverrideBuiltins]
           interface Bar {
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [Global] used on an interface with an "
                "[OverrideBuiltins] ancestor")
 
     parser = parser.reset()
     threw = False
@@ -91,14 +91,14 @@ def WebIDLTest(parser, harness):
         parser.parse("""
           [Global]
           interface Foo {
           };
           interface Bar : Foo {
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown for [Global] used on an interface with a "
                "descendant")
--- a/dom/bindings/parser/tests/test_identifier_conflict.py
+++ b/dom/bindings/parser/tests/test_identifier_conflict.py
@@ -1,39 +1,36 @@
 # Import the WebIDL module, so we can do isinstance checks and whatnot
-import WebIDL
-
 def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             enum Foo { "a" };
             interface Foo;
         """)
-        results = parser.finish()
+        parser.finish()
         harness.ok(False, "Should fail to parse")
     except Exception, e:
         harness.ok("Name collision" in e.message,
                    "Should have name collision for interface")
 
     parser = parser.reset()
     try:
         parser.parse("""
             dictionary Foo { long x; };
             enum Foo { "a" };
         """)
-        results = parser.finish()
+        parser.finish()
         harness.ok(False, "Should fail to parse")
     except Exception, e:
         harness.ok("Name collision" in e.message,
                    "Should have name collision for dictionary")
 
     parser = parser.reset()
     try:
         parser.parse("""
             enum Foo { "a" };
             enum Foo { "b" };
         """)
-        results = parser.finish()
+        parser.finish()
         harness.ok(False, "Should fail to parse")
     except Exception, e:
         harness.ok("Multiple unresolvable definitions" in e.message,
                    "Should have name collision for dictionary")
-
--- a/dom/bindings/parser/tests/test_implements.py
+++ b/dom/bindings/parser/tests/test_implements.py
@@ -1,26 +1,27 @@
 # Import the WebIDL module, so we can do isinstance checks and whatnot
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     # Basic functionality
     threw = False
     try:
         parser.parse("""
             A implements B;
             interface B {
               attribute long x;
             };
             interface A {
               attribute long y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(not threw, "Should not have thrown on implements statement "
                "before interfaces")
     harness.check(len(results), 3, "We have three statements")
     harness.ok(isinstance(results[1], WebIDL.IDLInterface), "B is an interface")
     harness.check(len(results[1].members), 1, "B has one member")
     A = results[2]
@@ -37,17 +38,17 @@ def WebIDLTest(parser, harness):
             interface D {
               attribute long x;
             };
             interface C {
               attribute long x;
             };
         """)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on implemented interface duplicating "
                "a name on base interface")
 
     # Same, but duplicated across implemented interfaces
     threw = False
     try:
@@ -58,17 +59,17 @@ def WebIDLTest(parser, harness):
               attribute long x;
             };
             interface G {
               attribute long x;
             };
             interface E {};
         """)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on implemented interfaces "
                "duplicating each other's member names")
 
     # Same, but duplicated across indirectly implemented interfaces
     threw = False
     try:
@@ -82,17 +83,17 @@ def WebIDLTest(parser, harness):
             interface L {
               attribute long x;
             };
             interface I {};
             interface J : L {};
             interface H {};
         """)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on indirectly implemented interfaces "
                "duplicating each other's member names")
 
     # Same, but duplicated across an implemented interface and its parent
     threw = False
     try:
@@ -102,17 +103,17 @@ def WebIDLTest(parser, harness):
               attribute long x;
             };
             interface N : O {
               attribute long x;
             };
             interface M {};
         """)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on implemented interface and its "
                "ancestor duplicating member names")
 
     # Reset the parser so we can actually find things where we expect
     # them in the list
     parser = parser.reset()
@@ -128,17 +129,17 @@ def WebIDLTest(parser, harness):
             interface Q {};
             interface R {};
             interface S {
               attribute long x;
             };
             interface P {};
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(not threw, "Diamond inheritance is fine")
     harness.check(results[6].identifier.name, "S", "We should be looking at 'S'")
     harness.check(len(results[6].members), 1, "S should have one member")
     harness.check(results[6].members[0].identifier.name, "x",
                   "S's member should be 'x'")
 
@@ -148,17 +149,17 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             interface TestInterface {
             };
             callback interface TestCallbackInterface {
             };
             TestInterface implements TestCallbackInterface;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should not allow callback interfaces on the right-hand side "
                "of 'implements'")
 
     parser = parser.reset()
     threw = False
@@ -166,35 +167,35 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             interface TestInterface {
             };
             callback interface TestCallbackInterface {
             };
             TestCallbackInterface implements TestInterface;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should not allow callback interfaces on the left-hand side of "
                "'implements'")
-    
+
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestInterface {
             };
             dictionary Dict {
             };
             Dict implements TestInterface;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should not allow non-interfaces on the left-hand side "
                "of 'implements'")
 
     parser = parser.reset()
     threw = False
@@ -202,15 +203,14 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             interface TestInterface {
             };
             dictionary Dict {
             };
             TestInterface implements Dict;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should not allow non-interfaces on the right-hand side "
                "of 'implements'")
-
--- a/dom/bindings/parser/tests/test_incomplete_parent.py
+++ b/dom/bindings/parser/tests/test_incomplete_parent.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestIncompleteParent : NotYetDefined {
           void foo();
         };
 
         interface NotYetDefined : EvenHigherOnTheChain {
         };
--- a/dom/bindings/parser/tests/test_incomplete_types.py
+++ b/dom/bindings/parser/tests/test_incomplete_types.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestIncompleteTypes {
           attribute FooInterface attr1;
 
           FooInterface method1(FooInterface arg);
         };
 
@@ -14,17 +15,18 @@ def WebIDLTest(parser, harness):
 
     results = parser.finish()
 
     harness.ok(True, "TestIncompleteTypes interface parsed without error.")
     harness.check(len(results), 2, "Should be two productions.")
     iface = results[0]
     harness.ok(isinstance(iface, WebIDL.IDLInterface),
                "Should be an IDLInterface")
-    harness.check(iface.identifier.QName(), "::TestIncompleteTypes", "Interface has the right QName")
+    harness.check(iface.identifier.QName(), "::TestIncompleteTypes",
+                  "Interface has the right QName")
     harness.check(iface.identifier.name, "TestIncompleteTypes", "Interface has the right name")
     harness.check(len(iface.members), 2, "Expect 2 members")
 
     attr = iface.members[0]
     harness.ok(isinstance(attr, WebIDL.IDLAttribute),
                "Should be an IDLAttribute")
     method = iface.members[1]
     harness.ok(isinstance(method, WebIDL.IDLMethod),
--- a/dom/bindings/parser/tests/test_interface.py
+++ b/dom/bindings/parser/tests/test_interface.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("interface Foo { };")
     results = parser.finish()
     harness.ok(True, "Empty interface parsed without error.")
     harness.check(len(results), 1, "Should be one production")
     harness.ok(isinstance(results[0], WebIDL.IDLInterface),
                "Should be an IDLInterface")
     iface = results[0]
@@ -27,17 +28,17 @@ def WebIDLTest(parser, harness):
     parser = parser.reset()
     parser.parse("""
         interface QNameBase {
           attribute long foo;
         };
 
         interface QNameDerived : QNameBase {
           attribute long long foo;
-          attribute byte bar;          
+          attribute byte bar;
         };
     """)
     results = parser.finish()
     harness.check(len(results), 2, "Should be two productions")
     harness.ok(isinstance(results[0], WebIDL.IDLInterface),
                "Should be an IDLInterface")
     harness.ok(isinstance(results[1], WebIDL.IDLInterface),
                "Should be an IDLInterface")
@@ -56,156 +57,157 @@ def WebIDLTest(parser, harness):
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : B {};
             interface B : A {};
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow cycles in interface inheritance chains")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : C {};
             interface C : B {};
             interface B : A {};
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow indirect cycles in interface inheritance chains")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {};
             interface B {};
             A implements B;
             B implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow cycles via implements")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {};
             interface C {};
             interface B {};
             A implements C;
             C implements B;
             B implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow indirect cycles via implements")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : B {};
             interface B {};
             B implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow inheriting from an interface that implements us")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : B {};
             interface B {};
             interface C {};
             B implements C;
             C implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
-    harness.ok(threw, "Should not allow inheriting from an interface that indirectly implements us")
+    harness.ok(threw, "Should not allow inheriting from an interface that indirectly implements us")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : B {};
             interface B : C {};
             interface C {};
             C implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
-    harness.ok(threw, "Should not allow indirectly inheriting from an interface that implements us")
+    harness.ok(threw, "Should not allow indirectly inheriting from an interface that implements us")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A : B {};
             interface B : C {};
             interface C {};
             interface D {};
             C implements D;
             D implements A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
-    harness.ok(threw, "Should not allow indirectly inheriting from an interface that indirectly implements us")
+    harness.ok(
+        threw, "Should not allow indirectly inheriting from an interface that indirectly implements us")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A;
             interface B : A {};
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
-    harness.ok(threw, "Should not allow inheriting from an interface that is only forward declared")
+    harness.ok(threw, "Should not allow inheriting from an interface that is only forward declared")  # NOQA: E501
 
     parser = parser.reset()
     parser.parse("""
         [Constructor(long arg)]
         interface A {
             readonly attribute boolean x;
             void foo();
         };
         [Constructor]
         partial interface A {
             readonly attribute boolean y;
             void foo(long arg);
         };
-    """);
-    results = parser.finish();
+    """)
+    results = parser.finish()
     harness.check(len(results), 2,
                   "Should have two results with partial interface")
     iface = results[0]
     harness.check(len(iface.members), 3,
                   "Should have three members with partial interface")
     harness.check(iface.members[0].identifier.name, "x",
                   "First member should be x with partial interface")
     harness.check(iface.members[1].identifier.name, "foo",
@@ -224,18 +226,18 @@ def WebIDLTest(parser, harness):
             readonly attribute boolean y;
             void foo(long arg);
         };
         [Constructor(long arg)]
         interface A {
             readonly attribute boolean x;
             void foo();
         };
-    """);
-    results = parser.finish();
+    """)
+    results = parser.finish()
     harness.check(len(results), 2,
                   "Should have two results with reversed partial interface")
     iface = results[1]
     harness.check(len(iface.members), 3,
                   "Should have three members with reversed partial interface")
     harness.check(iface.members[0].identifier.name, "x",
                   "First member should be x with reversed partial interface")
     harness.check(iface.members[1].identifier.name, "foo",
@@ -254,51 +256,51 @@ def WebIDLTest(parser, harness):
             interface A {
                 readonly attribute boolean x;
             };
             interface A {
                 readonly attribute boolean y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow two non-partial interfaces with the same name")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             partial interface A {
                 readonly attribute boolean x;
             };
             partial interface A {
                 readonly attribute boolean y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Must have a non-partial interface for a given name")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary  A {
                 boolean x;
             };
             partial interface A {
                 readonly attribute boolean y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow a name collision between partial interface "
                "and other object")
 
     parser = parser.reset()
     threw = False
     try:
@@ -306,49 +308,49 @@ def WebIDLTest(parser, harness):
             dictionary A {
                 boolean x;
             };
             interface A {
                 readonly attribute boolean y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow a name collision between interface "
                "and other object")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary A {
                 boolean x;
             };
             interface A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow a name collision between external interface "
                "and other object")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
                 readonly attribute boolean x;
             };
             interface A;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow a name collision between external interface "
                "and interface")
 
     parser = parser.reset()
     parser.parse("""
         interface A;
@@ -365,12 +367,12 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             [SomeRandomAnnotation]
             interface A {
                 readonly attribute boolean y;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow unknown extended attributes on interfaces")
--- a/dom/bindings/parser/tests/test_interface_const_identifier_conflicts.py
+++ b/dom/bindings/parser/tests/test_interface_const_identifier_conflicts.py
@@ -3,13 +3,13 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             interface IdentifierConflict {
               const byte thing1 = 1;
               const unsigned long thing1 = 1;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py
+++ b/dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py
@@ -3,58 +3,58 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             interface IdentifierConflictAcrossMembers1 {
               const byte thing1 = 1;
               readonly attribute long thing1;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface IdentifierConflictAcrossMembers2 {
               readonly attribute long thing1;
               const byte thing1 = 1;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface IdentifierConflictAcrossMembers3 {
               getter boolean thing1(DOMString name);
               readonly attribute long thing1;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface IdentifierConflictAcrossMembers1 {
               const byte thing1 = 1;
               long thing1();
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_interface_maplikesetlikeiterable.py
+++ b/dom/bindings/parser/tests/test_interface_maplikesetlikeiterable.py
@@ -1,10 +1,11 @@
 import WebIDL
-import traceback
+
+
 def WebIDLTest(parser, harness):
 
     def shouldPass(prefix, iface, expectedMembers, numProductions=1):
         p = parser.reset()
         p.parse(iface)
         results = p.finish()
         harness.check(len(results), numProductions,
                       "%s - Should have production count %d" % (prefix, numProductions))
@@ -627,17 +628,17 @@ def WebIDLTest(parser, harness):
                [Unforgeable]
                attribute double size;
                };
                interface Foo2 : Foo1 {
                maplike<long, long>;
                };
                """)
 
-    shouldFail("Inheritance of multi-level unforgeable attribute collision with child maplike/setlike",
+    shouldFail("Inheritance of multi-level unforgeable attribute collision with child maplike/setlike",  # NOQA: E501
                """
                interface Foo1 {
                [Unforgeable]
                attribute double size;
                };
                interface Foo2 : Foo1 {
                };
                interface Foo3 : Foo2 {
--- a/dom/bindings/parser/tests/test_lenientSetter.py
+++ b/dom/bindings/parser/tests/test_lenientSetter.py
@@ -1,19 +1,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+
 def should_throw(parser, harness, message, code):
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse(code)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown: %s" % message)
 
 
 def WebIDLTest(parser, harness):
     # The [LenientSetter] extended attribute MUST take no arguments.
     should_throw(parser, harness, "no arguments", """
--- a/dom/bindings/parser/tests/test_method.py
+++ b/dom/bindings/parser/tests/test_method.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestMethods {
           void basic();
           static void basicStatic();
           void basicWithSimpleArgs(boolean arg1, byte arg2, unsigned long arg3);
           boolean basicBoolean();
           static boolean basicStaticBoolean();
@@ -49,19 +50,22 @@ def WebIDLTest(parser, harness):
         harness.ok(not method.isAttr(), "Method is not an attr")
         harness.ok(not method.isConst(), "Method is not a const")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         harness.check(method.isStatic(), static, "Method has the correct static value")
         harness.check(method.isGetter(), getter, "Method has the correct getter value")
         harness.check(method.isSetter(), setter, "Method has the correct setter value")
         harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
-        harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
-        harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
-        harness.check(len(method.signatures()), len(signatures), "Method has the correct number of signatures")
+        harness.check(method.isLegacycaller(), legacycaller,
+                      "Method has the correct legacycaller value")
+        harness.check(method.isStringifier(), stringifier,
+                      "Method has the correct stringifier value")
+        harness.check(len(method.signatures()), len(signatures),
+                      "Method has the correct number of signatures")
 
         sigpairs = zip(method.signatures(), signatures)
         for (gotSignature, expectedSignature) in sigpairs:
             (gotRetType, gotArgs) = gotSignature
             (expectedRetType, expectedArgs) = expectedSignature
 
             harness.check(str(gotRetType), expectedRetType,
                           "Method has the expected return type.")
@@ -70,108 +74,115 @@ def WebIDLTest(parser, harness):
                 (QName, name, type, optional, variadic) = expectedArgs[i]
                 checkArgument(gotArgs[i], QName, name, type, optional, variadic)
 
     checkMethod(methods[0], "::TestMethods::basic", "basic", [("Void", [])])
     checkMethod(methods[1], "::TestMethods::basicStatic", "basicStatic",
                 [("Void", [])], static=True)
     checkMethod(methods[2], "::TestMethods::basicWithSimpleArgs",
                 "basicWithSimpleArgs",
-       [("Void",
-        [("::TestMethods::basicWithSimpleArgs::arg1", "arg1", "Boolean", False, False),
-         ("::TestMethods::basicWithSimpleArgs::arg2", "arg2", "Byte", False, False),
-         ("::TestMethods::basicWithSimpleArgs::arg3", "arg3", "UnsignedLong", False, False)])])
+                [("Void",
+                  [("::TestMethods::basicWithSimpleArgs::arg1", "arg1", "Boolean",
+                    False, False),
+                   ("::TestMethods::basicWithSimpleArgs::arg2", "arg2", "Byte",
+                    False, False),
+                   ("::TestMethods::basicWithSimpleArgs::arg3", "arg3", "UnsignedLong",
+                    False, False)])])
     checkMethod(methods[3], "::TestMethods::basicBoolean", "basicBoolean", [("Boolean", [])])
-    checkMethod(methods[4], "::TestMethods::basicStaticBoolean", "basicStaticBoolean", [("Boolean", [])], static=True)
+    checkMethod(methods[4], "::TestMethods::basicStaticBoolean",
+                "basicStaticBoolean", [("Boolean", [])], static=True)
     checkMethod(methods[5], "::TestMethods::basicBooleanWithSimpleArgs",
                 "basicBooleanWithSimpleArgs",
-       [("Boolean",
-        [("::TestMethods::basicBooleanWithSimpleArgs::arg1", "arg1", "Boolean", False, False),
-         ("::TestMethods::basicBooleanWithSimpleArgs::arg2", "arg2", "Byte", False, False),
-         ("::TestMethods::basicBooleanWithSimpleArgs::arg3", "arg3", "UnsignedLong", False, False)])])
+                [("Boolean",
+                  [("::TestMethods::basicBooleanWithSimpleArgs::arg1", "arg1", "Boolean",
+                    False, False),
+                   ("::TestMethods::basicBooleanWithSimpleArgs::arg2", "arg2", "Byte",
+                    False, False),
+                   ("::TestMethods::basicBooleanWithSimpleArgs::arg3", "arg3", "UnsignedLong",
+                    False, False)])])
     checkMethod(methods[6], "::TestMethods::optionalArg",
                 "optionalArg",
-       [("Void",
-        [("::TestMethods::optionalArg::arg1", "arg1", "ByteOrNull", True, False),
-         ("::TestMethods::optionalArg::arg2", "arg2", "ByteSequence", True, False)])])
+                [("Void",
+                  [("::TestMethods::optionalArg::arg1", "arg1", "ByteOrNull", True, False),
+                   ("::TestMethods::optionalArg::arg2", "arg2", "ByteSequence", True, False)])])
     checkMethod(methods[7], "::TestMethods::variadicArg",
                 "variadicArg",
-       [("Void",
-        [("::TestMethods::variadicArg::arg1", "arg1", "ByteOrNull", True, True)])])
+                [("Void",
+                  [("::TestMethods::variadicArg::arg1", "arg1", "ByteOrNull", True, True)])])
     checkMethod(methods[8], "::TestMethods::getObject",
                 "getObject", [("Object", [])])
     checkMethod(methods[9], "::TestMethods::setObject",
                 "setObject",
-       [("Void",
-        [("::TestMethods::setObject::arg1", "arg1", "Object", False, False)])])
+                [("Void",
+                  [("::TestMethods::setObject::arg1", "arg1", "Object", False, False)])])
     checkMethod(methods[10], "::TestMethods::setAny",
                 "setAny",
-       [("Void",
-        [("::TestMethods::setAny::arg1", "arg1", "Any", False, False)])])
+                [("Void",
+                  [("::TestMethods::setAny::arg1", "arg1", "Any", False, False)])])
     checkMethod(methods[11], "::TestMethods::doFloats",
                 "doFloats",
-       [("Float",
-        [("::TestMethods::doFloats::arg1", "arg1", "Float", False, False)])])
+                [("Float",
+                  [("::TestMethods::doFloats::arg1", "arg1", "Float", False, False)])])
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             void foo(optional float bar = 1);
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(not threw, "Should allow integer to float type corecion")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [GetterThrows] void foo();
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow [GetterThrows] on methods")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [SetterThrows] void foo();
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow [SetterThrows] on methods")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             [Throw] void foo();
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should spell [Throws] correctly on methods")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface A {
             void __noSuchMethod__();
           };
         """)
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow __noSuchMethod__ methods")
--- a/dom/bindings/parser/tests/test_namespace.py
+++ b/dom/bindings/parser/tests/test_namespace.py
@@ -4,17 +4,17 @@ def WebIDLTest(parser, harness):
         namespace MyNamespace {
           attribute any foo;
           any bar();
         };
         """)
 
     results = parser.finish()
     harness.check(len(results), 1, "Should have a thing.")
-    harness.ok(results[0].isNamespace(), "Our thing should be a namespace");
+    harness.ok(results[0].isNamespace(), "Our thing should be a namespace")
     harness.check(len(results[0].members), 2,
                   "Should have two things in our namespace")
     harness.ok(results[0].members[0].isAttr(), "First member is attribute")
     harness.ok(results[0].members[0].isStatic(), "Attribute should be static")
     harness.ok(results[0].members[1].isMethod(), "Second member is method")
     harness.ok(results[0].members[1].isStatic(), "Operation should be static")
 
     parser = parser.reset()
@@ -25,72 +25,72 @@ def WebIDLTest(parser, harness):
         };
         partial namespace MyNamespace {
           any bar();
         };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2, "Should have things.")
-    harness.ok(results[0].isNamespace(), "Our thing should be a namespace");
+    harness.ok(results[0].isNamespace(), "Our thing should be a namespace")
     harness.check(len(results[0].members), 2,
                   "Should have two things in our namespace")
     harness.ok(results[0].members[0].isAttr(), "First member is attribute")
-    harness.ok(results[0].members[0].isStatic(), "Attribute should be static");
+    harness.ok(results[0].members[0].isStatic(), "Attribute should be static")
     harness.ok(results[0].members[1].isMethod(), "Second member is method")
-    harness.ok(results[0].members[1].isStatic(), "Operation should be static");
+    harness.ok(results[0].members[1].isStatic(), "Operation should be static")
 
     parser = parser.reset()
     parser.parse(
         """
         partial namespace MyNamespace {
           any bar();
         };
         namespace MyNamespace {
           attribute any foo;
         };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2, "Should have things.")
-    harness.ok(results[1].isNamespace(), "Our thing should be a namespace");
+    harness.ok(results[1].isNamespace(), "Our thing should be a namespace")
     harness.check(len(results[1].members), 2,
                   "Should have two things in our namespace")
     harness.ok(results[1].members[0].isAttr(), "First member is attribute")
-    harness.ok(results[1].members[0].isStatic(), "Attribute should be static");
+    harness.ok(results[1].members[0].isStatic(), "Attribute should be static")
     harness.ok(results[1].members[1].isMethod(), "Second member is method")
-    harness.ok(results[1].members[1].isStatic(), "Operation should be static");
+    harness.ok(results[1].members[1].isStatic(), "Operation should be static")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             namespace MyNamespace {
               static attribute any foo;
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             namespace MyNamespace {
               static any bar();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -99,17 +99,17 @@ def WebIDLTest(parser, harness):
             };
 
             interface MyNamespace {
               any baz();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -118,17 +118,17 @@ def WebIDLTest(parser, harness):
             };
 
             namespace MyNamespace {
               any bar();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -137,17 +137,17 @@ def WebIDLTest(parser, harness):
             };
 
             namespace MyNamespace {
               any bar();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -156,17 +156,17 @@ def WebIDLTest(parser, harness):
             };
 
             interface MyNamespace {
               any bar();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -175,17 +175,17 @@ def WebIDLTest(parser, harness):
             };
 
             partial interface MyNamespace {
               any baz();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -194,17 +194,17 @@ def WebIDLTest(parser, harness):
             };
 
             namespace MyNamespace {
               any bar();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
@@ -213,11 +213,11 @@ def WebIDLTest(parser, harness):
             };
 
             partial namespace MyNamespace {
               any baz();
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_newobject.py
+++ b/dom/bindings/parser/tests/test_newobject.py
@@ -1,11 +1,9 @@
 # Import the WebIDL module, so we can do isinstance checks and whatnot
-import WebIDL
-
 def WebIDLTest(parser, harness):
     # Basic functionality
     parser.parse(
         """
         interface Iface {
           [NewObject] readonly attribute Iface attr;
           [NewObject] Iface method();
         };
@@ -18,53 +16,53 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse(
             """
             interface Iface {
               [Pure, NewObject] readonly attribute Iface attr;
             };
             """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[NewObject] attributes must depend on something")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Iface {
               [Pure, NewObject] Iface method();
             };
             """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[NewObject] methods must depend on something")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Iface {
               [Cached, NewObject, Affects=Nothing] readonly attribute Iface attr;
             };
             """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[NewObject] attributes must not be [Cached]")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Iface {
               [StoreInSlot, NewObject, Affects=Nothing] readonly attribute Iface attr;
             };
             """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[NewObject] attributes must not be [StoreInSlot]")
--- a/dom/bindings/parser/tests/test_nullable_equivalency.py
+++ b/dom/bindings/parser/tests/test_nullable_equivalency.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestNullableEquivalency1 {
           attribute long  a;
           attribute long? b;
         };
 
         interface TestNullableEquivalency2 {
@@ -54,16 +52,17 @@ def WebIDLTest(parser, harness):
           attribute object? b;
         };
     """)
 
     for decl in parser.finish():
         if decl.isInterface():
             checkEquivalent(decl, harness)
 
+
 def checkEquivalent(iface, harness):
     type1 = iface.members[0].type
     type2 = iface.members[1].type
 
     harness.check(type1.nullable(), False, 'attr1 should not be nullable')
     harness.check(type2.nullable(), True, 'attr2 should be nullable')
 
     # We don't know about type1, but type2, the nullable type, definitely
@@ -84,32 +83,33 @@ def checkEquivalent(iface, harness):
            (hasattr(type(type1), attr) and not callable(getattr(type1, attr))):
             continue
 
         a1 = getattr(type1, attr)
 
         if callable(a1):
             try:
                 v1 = a1()
-            except:
+            except Exception:
                 # Can't call a1 with no args, so skip this attriute.
                 continue
 
             try:
                 a2 = getattr(type2, attr)
-            except:
+            except Exception:
                 harness.ok(False, 'Missing %s attribute on type %s in %s' % (attr, type2, iface))
                 continue
 
             if not callable(a2):
-                harness.ok(False, "%s attribute on type %s in %s wasn't callable" % (attr, type2, iface))
+                harness.ok(False, "%s attribute on type %s in %s wasn't callable" %
+                           (attr, type2, iface))
                 continue
 
             v2 = a2()
             harness.check(v2, v1, '%s method return value' % attr)
         else:
             try:
                 a2 = getattr(type2, attr)
-            except:
+            except Exception:
                 harness.ok(False, 'Missing %s attribute on type %s in %s' % (attr, type2, iface))
                 continue
 
             harness.check(a2, a1, '%s attribute should match' % attr)
--- a/dom/bindings/parser/tests/test_nullable_void.py
+++ b/dom/bindings/parser/tests/test_nullable_void.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface NullableVoid {
               void? foo();
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_optional_constraints.py
+++ b/dom/bindings/parser/tests/test_optional_constraints.py
@@ -3,17 +3,17 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             interface OptionalConstraints1 {
               void foo(optional byte arg1, byte arg2);
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(not threw,
                "Should not have thrown on non-optional argument following "
                "optional argument.")
 
     parser = parser.reset()
     parser.parse("""
--- a/dom/bindings/parser/tests/test_overload.py
+++ b/dom/bindings/parser/tests/test_overload.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestOverloads {
           void basic();
           void basic(long arg1);
           boolean abitharder(TestOverloads foo);
           boolean abitharder(boolean foo);
           void abitharder(ArrayBuffer? foo);
@@ -23,17 +24,18 @@ def WebIDLTest(parser, harness):
     iface = results[0]
     harness.ok(isinstance(iface, WebIDL.IDLInterface),
                "Should be an IDLInterface")
     harness.check(iface.identifier.QName(), "::TestOverloads", "Interface has the right QName")
     harness.check(iface.identifier.name, "TestOverloads", "Interface has the right name")
     harness.check(len(iface.members), 4, "Expect %s members" % 4)
 
     member = iface.members[0]
-    harness.check(member.identifier.QName(), "::TestOverloads::basic", "Method has the right QName")
+    harness.check(member.identifier.QName(), "::TestOverloads::basic",
+                  "Method has the right QName")
     harness.check(member.identifier.name, "basic", "Method has the right name")
     harness.check(member.hasOverloads(), True, "Method has overloads")
 
     signatures = member.signatures()
     harness.check(len(signatures), 2, "Method should have 2 signatures")
 
     (retval, argumentSet) = signatures[0]
 
@@ -42,17 +44,18 @@ def WebIDLTest(parser, harness):
 
     (retval, argumentSet) = signatures[1]
     harness.check(str(retval), "Void", "Expect a void retval")
     harness.check(len(argumentSet), 1, "Expect an argument set with one argument")
 
     argument = argumentSet[0]
     harness.ok(isinstance(argument, WebIDL.IDLArgument),
                "Should be an IDLArgument")
-    harness.check(argument.identifier.QName(), "::TestOverloads::basic::arg1", "Argument has the right QName")
+    harness.check(argument.identifier.QName(), "::TestOverloads::basic::arg1",
+                  "Argument has the right QName")
     harness.check(argument.identifier.name, "arg1", "Argument has the right name")
     harness.check(str(argument.type), "Long", "Argument has the right type")
 
     member = iface.members[3]
     harness.check(len(member.overloadsForArgCount(0)), 1,
                   "Only one overload for no args")
     harness.check(len(member.overloadsForArgCount(1)), 0,
                   "No overloads for one arg")
--- a/dom/bindings/parser/tests/test_promise.py
+++ b/dom/bindings/parser/tests/test_promise.py
@@ -1,157 +1,157 @@
 def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface A {
               legacycaller Promise<any> foo();
             };
         """)
-        results = parser.finish()
+        parser.finish()
 
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow Promise return values for legacycaller.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               Promise<any> foo();
               long foo(long arg);
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow overloads which have both Promise and "
                "non-Promise return types.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               long foo(long arg);
               Promise<any> foo();
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow overloads which have both Promise and "
                "non-Promise return types.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               Promise<any>? foo();
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow nullable Promise return values.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               void foo(Promise<any>? arg);
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow nullable Promise arguments.")
 
     parser = parser.reset()
     parser.parse("""
         interface A {
           Promise<any> foo();
           Promise<any> foo(long arg);
         };
     """)
-    results = parser.finish();
+    parser.finish()
 
     harness.ok(True,
                "Should allow overloads which only have Promise and return "
                "types.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               attribute Promise<any> attr;
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow writable Promise-typed attributes.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               [LenientSetter] readonly attribute Promise<any> attr;
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow [LenientSetter] Promise-typed attributes.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               [PutForwards=bar] readonly attribute Promise<any> attr;
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow [PutForwards] Promise-typed attributes.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               [Replaceable] readonly attribute Promise<any> attr;
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow [Replaceable] Promise-typed attributes.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface A {
               [SameObject] readonly attribute Promise<any> attr;
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should not allow [SameObject] Promise-typed attributes.")
--- a/dom/bindings/parser/tests/test_prototype_ident.py
+++ b/dom/bindings/parser/tests/test_prototype_ident.py
@@ -2,79 +2,81 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface TestIface {
               static attribute boolean prototype;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "The identifier of a static attribute must not be 'prototype'")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestIface {
               static boolean prototype();
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "The identifier of a static operation must not be 'prototype'")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestIface {
               const boolean prototype = true;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "The identifier of a constant must not be 'prototype'")
 
     # Make sure that we can parse non-static attributes with 'prototype' as identifier.
     parser = parser.reset()
     parser.parse("""
         interface TestIface {
           attribute boolean prototype;
         };
     """)
     results = parser.finish()
 
-    testIface = results[0];
+    testIface = results[0]
     harness.check(testIface.members[0].isStatic(), False, "Attribute should not be static")
-    harness.check(testIface.members[0].identifier.name, "prototype", "Attribute identifier should be 'prototype'")
+    harness.check(testIface.members[0].identifier.name, "prototype",
+                  "Attribute identifier should be 'prototype'")
 
     # Make sure that we can parse non-static operations with 'prototype' as identifier.
     parser = parser.reset()
     parser.parse("""
         interface TestIface {
           boolean prototype();
         };
     """)
     results = parser.finish()
 
-    testIface = results[0];
+    testIface = results[0]
     harness.check(testIface.members[0].isStatic(), False, "Operation should not be static")
-    harness.check(testIface.members[0].identifier.name, "prototype", "Operation identifier should be 'prototype'")
+    harness.check(testIface.members[0].identifier.name, "prototype",
+                  "Operation identifier should be 'prototype'")
 
     # Make sure that we can parse dictionary members with 'prototype' as identifier.
     parser = parser.reset()
     parser.parse("""
         dictionary TestDict {
           boolean prototype;
         };
     """)
     results = parser.finish()
 
-    testDict = results[0];
-    harness.check(testDict.members[0].identifier.name, "prototype", "Dictionary member should be 'prototype'")
-
+    testDict = results[0]
+    harness.check(testDict.members[0].identifier.name, "prototype",
+                  "Dictionary member should be 'prototype'")
--- a/dom/bindings/parser/tests/test_putForwards.py
+++ b/dom/bindings/parser/tests/test_putForwards.py
@@ -2,106 +2,106 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface I {
               [PutForwards=B] readonly attribute long A;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface I {
               [PutForwards=B] readonly attribute J A;
             };
             interface J {
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface I {
               [PutForwards=B] attribute J A;
             };
             interface J {
               attribute long B;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface I {
               [PutForwards=B] static readonly attribute J A;
             };
             interface J {
               attribute long B;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             callback interface I {
               [PutForwards=B] readonly attribute J A;
             };
             interface J {
               attribute long B;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface I {
               [PutForwards=C] readonly attribute J A;
               [PutForwards=C] readonly attribute J B;
             };
             interface J {
               [PutForwards=D] readonly attribute K C;
             };
             interface K {
               [PutForwards=A] readonly attribute I D;
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_record.py
+++ b/dom/bindings/parser/tests/test_record.py
@@ -1,23 +1,24 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         dictionary Dict {};
         interface RecordArg {
           void foo(record<DOMString, Dict> arg);
         };
     """)
 
     results = parser.finish()
 
-    harness.check(len(results), 2, "Should know about two things");
+    harness.check(len(results), 2, "Should know about two things")
     harness.ok(isinstance(results[1], WebIDL.IDLInterface),
-               "Should have an interface here");
+               "Should have an interface here")
     members = results[1].members
     harness.check(len(members), 1, "Should have one member")
     harness.ok(members[0].isMethod(), "Should have method")
     signature = members[0].signatures()[0]
     args = signature[1]
     harness.check(len(args), 1, "Should have one arg")
     harness.ok(args[0].type.isRecord(), "Should have a record type here")
     harness.ok(args[0].type.inner.isDictionary(),
@@ -28,26 +29,26 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             interface RecordVoidArg {
               void foo(record<DOMString, void> arg);
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown because record can't have void as value type.")
- 
+
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             dictionary Dict {
               record<DOMString, Dict> val;
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should have thrown on dictionary containing itself via record.")
--- a/dom/bindings/parser/tests/test_replaceable.py
+++ b/dom/bindings/parser/tests/test_replaceable.py
@@ -1,19 +1,20 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+
 def should_throw(parser, harness, message, code):
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse(code)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown: %s" % message)
 
 
 def WebIDLTest(parser, harness):
     # The [Replaceable] extended attribute MUST take no arguments.
     should_throw(parser, harness, "no arguments", """
--- a/dom/bindings/parser/tests/test_securecontext_extended_attribute.py
+++ b/dom/bindings/parser/tests/test_securecontext_extended_attribute.py
@@ -1,40 +1,39 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         [SecureContext]
         interface TestSecureContextOnInterface {
           const octet TEST_CONSTANT = 0;
           readonly attribute byte testAttribute;
           void testMethod(byte foo);
         };
         partial interface TestSecureContextOnInterface {
           const octet TEST_CONSTANT_2 = 0;
           readonly attribute byte testAttribute2;
           void testMethod2(byte foo);
         };
     """)
     results = parser.finish()
-    harness.check(len(results[0].members), 6, "TestSecureContextOnInterface should have six members")
+    harness.check(len(results[0].members), 6,
+                  "TestSecureContextOnInterface should have six members")
     harness.ok(results[0].getExtendedAttribute("SecureContext"),
                "Interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to constant members")
     harness.ok(results[0].members[1].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to attribute members")
     harness.ok(results[0].members[2].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to method members")
     harness.ok(results[0].members[3].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to constant members from partial interface")
+               "[SecureContext] should propagate from interface to constant members from partial interface")  # NOQA: E501
     harness.ok(results[0].members[4].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to attribute members from partial interface")
+               "[SecureContext] should propagate from interface to attribute members from partial interface")  # NOQA: E501
     harness.ok(results[0].members[5].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to method members from partial interface")
+               "[SecureContext] should propagate from interface to method members from partial interface")  # NOQA: E501
 
     # Same thing, but with the partial interface specified first:
     parser = parser.reset()
     parser.parse("""
         partial interface TestSecureContextOnInterfaceAfterPartialInterface {
           const octet TEST_CONSTANT_2 = 0;
           readonly attribute byte testAttribute2;
           void testMethod2(byte foo);
@@ -42,60 +41,62 @@ def WebIDLTest(parser, harness):
         [SecureContext]
         interface TestSecureContextOnInterfaceAfterPartialInterface {
           const octet TEST_CONSTANT = 0;
           readonly attribute byte testAttribute;
           void testMethod(byte foo);
         };
      """)
     results = parser.finish()
-    harness.check(len(results[1].members), 6, "TestSecureContextOnInterfaceAfterPartialInterface should have six members")
+    harness.check(len(results[1].members), 6,
+                  "TestSecureContextOnInterfaceAfterPartialInterface should have six members")
     harness.ok(results[1].getExtendedAttribute("SecureContext"),
                "Interface should have [SecureContext] extended attribute")
     harness.ok(results[1].members[0].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to constant members")
     harness.ok(results[1].members[1].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to attribute members")
     harness.ok(results[1].members[2].getExtendedAttribute("SecureContext"),
                "[SecureContext] should propagate from interface to method members")
     harness.ok(results[1].members[3].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to constant members from partial interface")
+               "[SecureContext] should propagate from interface to constant members from partial interface")  # NOQA: E501
     harness.ok(results[1].members[4].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to attribute members from partial interface")
+               "[SecureContext] should propagate from interface to attribute members from partial interface")  # NOQA: E501
     harness.ok(results[1].members[5].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to method members from partial interface")
+               "[SecureContext] should propagate from interface to method members from partial interface")  # NOQA: E501
 
     parser = parser.reset()
     parser.parse("""
         interface TestSecureContextOnPartialInterface {
           const octet TEST_CONSTANT = 0;
           readonly attribute byte testAttribute;
           void testMethod(byte foo);
         };
         [SecureContext]
         partial interface TestSecureContextOnPartialInterface {
           const octet TEST_CONSTANT_2 = 0;
           readonly attribute byte testAttribute2;
           void testMethod2(byte foo);
         };
     """)
     results = parser.finish()
-    harness.check(len(results[0].members), 6, "TestSecureContextOnPartialInterface should have six members")
+    harness.check(len(results[0].members), 6,
+                  "TestSecureContextOnPartialInterface should have six members")
     harness.ok(results[0].getExtendedAttribute("SecureContext") is None,
                "[SecureContext] should not propagate from a partial interface to the interface")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext") is None,
-               "[SecureContext] should not propagate from a partial interface to the interface's constant members")
+               "[SecureContext] should not propagate from a partial interface to the interface's constant members")  # NOQA: E501
     harness.ok(results[0].members[1].getExtendedAttribute("SecureContext") is None,
-               "[SecureContext] should not propagate from a partial interface to the interface's attribute members")
+               "[SecureContext] should not propagate from a partial interface to the interface's attribute members")  # NOQA: E501
     harness.ok(results[0].members[2].getExtendedAttribute("SecureContext") is None,
-               "[SecureContext] should not propagate from a partial interface to the interface's method members")
+               "[SecureContext] should not propagate from a partial interface to the interface's method members")  # NOQA: E501
     harness.ok(results[0].members[3].getExtendedAttribute("SecureContext"),
                "Constant members from [SecureContext] partial interface should be [SecureContext]")
     harness.ok(results[0].members[4].getExtendedAttribute("SecureContext"),
-               "Attribute members from [SecureContext] partial interface should be [SecureContext]")
+               "Attribute members from [SecureContext] partial interface should be [SecureContext]")  # NOQA: E501
     harness.ok(results[0].members[5].getExtendedAttribute("SecureContext"),
                "Method members from [SecureContext] partial interface should be [SecureContext]")
 
     parser = parser.reset()
     parser.parse("""
         interface TestSecureContextOnInterfaceMembers {
           const octet TEST_NON_SECURE_CONSTANT_1 = 0;
           [SecureContext]
@@ -107,17 +108,18 @@ def WebIDLTest(parser, harness):
           readonly attribute byte testNonSecureAttribute2;
           void testNonSecureMethod1(byte foo);
           [SecureContext]
           void testSecureMethod(byte foo);
           void testNonSecureMethod2(byte foo);
         };
     """)
     results = parser.finish()
-    harness.check(len(results[0].members), 9, "TestSecureContextOnInterfaceMembers should have nine members")
+    harness.check(len(results[0].members), 9,
+                  "TestSecureContextOnInterfaceMembers should have nine members")
     harness.ok(results[0].getExtendedAttribute("SecureContext") is None,
                "[SecureContext] on members should not propagate up to the interface")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext") is None,
                "Constant should not have [SecureContext] extended attribute")
     harness.ok(results[0].members[1].getExtendedAttribute("SecureContext"),
                "Constant should have [SecureContext] extended attribute")
     harness.ok(results[0].members[2].getExtendedAttribute("SecureContext") is None,
                "Constant should not have [SecureContext] extended attribute")
@@ -149,29 +151,30 @@ def WebIDLTest(parser, harness):
           readonly attribute byte testNonSecureAttribute2;
           void testNonSecureMethod1(byte foo);
           [SecureContext]
           void testSecureMethod(byte foo);
           void testNonSecureMethod2(byte foo);
         };
     """)
     results = parser.finish()
-    harness.check(len(results[0].members), 9, "TestSecureContextOnPartialInterfaceMembers should have nine members")
+    harness.check(len(results[0].members), 9,
+                  "TestSecureContextOnPartialInterfaceMembers should have nine members")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext") is None,
-               "Constant from partial interface should not have [SecureContext] extended attribute")
+               "Constant from partial interface should not have [SecureContext] extended attribute")  # NOQA: E501
     harness.ok(results[0].members[1].getExtendedAttribute("SecureContext"),
                "Constant from partial interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[2].getExtendedAttribute("SecureContext") is None,
-               "Constant from partial interface should not have [SecureContext] extended attribute")
+               "Constant from partial interface should not have [SecureContext] extended attribute")  # NOQA: E501
     harness.ok(results[0].members[3].getExtendedAttribute("SecureContext") is None,
-               "Attribute from partial interface should not have [SecureContext] extended attribute")
+               "Attribute from partial interface should not have [SecureContext] extended attribute")  # NOQA: E501
     harness.ok(results[0].members[4].getExtendedAttribute("SecureContext"),
                "Attribute from partial interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[5].getExtendedAttribute("SecureContext") is None,
-               "Attribute from partial interface should not have [SecureContext] extended attribute")
+               "Attribute from partial interface should not have [SecureContext] extended attribute")  # NOQA: E501
     harness.ok(results[0].members[6].getExtendedAttribute("SecureContext") is None,
                "Method from partial interface should not have [SecureContext] extended attribute")
     harness.ok(results[0].members[7].getExtendedAttribute("SecureContext"),
                "Method from partial interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[8].getExtendedAttribute("SecureContext") is None,
                "Method from partial interface should not have [SecureContext] extended attribute")
 
     parser = parser.reset()
@@ -179,154 +182,161 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             [SecureContext=something]
             interface TestSecureContextTakesNoValue1 {
               const octet TEST_SECURE_CONSTANT = 0;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[SecureContext] must take no arguments (testing on interface)")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestSecureContextForOverloads1 {
               [SecureContext]
               void testSecureMethod(byte foo);
             };
             partial interface TestSecureContextForOverloads1 {
               void testSecureMethod(byte foo, byte bar);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
-    harness.ok(threw, "If [SecureContext] appears on an overloaded operation, then it MUST appear on all overloads")
+    harness.ok(
+        threw, "If [SecureContext] appears on an overloaded operation, then it MUST appear on all overloads")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestSecureContextForOverloads2 {
               [SecureContext]
               void testSecureMethod(byte foo);
             };
             partial interface TestSecureContextForOverloads2 {
               [SecureContext]
               void testSecureMethod(byte foo, byte bar);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
-    harness.ok(not threw, "[SecureContext] can appear on an overloaded operation if it appears on all overloads")
+    harness.ok(
+        not threw, "[SecureContext] can appear on an overloaded operation if it appears on all overloads")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [SecureContext]
             interface TestSecureContextOnInterfaceAndMember {
               [SecureContext]
               void testSecureMethod(byte foo);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw, "[SecureContext] must not appear on an interface and interface member")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface TestSecureContextOnPartialInterfaceAndMember {
             };
             [SecureContext]
             partial interface TestSecureContextOnPartialInterfaceAndMember {
               [SecureContext]
               void testSecureMethod(byte foo);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
-    harness.ok(threw, "[SecureContext] must not appear on a partial interface and one of the partial interface's member's")
+    harness.ok(
+        threw, "[SecureContext] must not appear on a partial interface and one of the partial interface's member's")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [SecureContext]
             interface TestSecureContextOnInterfaceAndPartialInterfaceMember {
             };
             partial interface TestSecureContextOnInterfaceAndPartialInterfaceMember {
               [SecureContext]
               void testSecureMethod(byte foo);
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
-    harness.ok(threw, "[SecureContext] must not appear on an interface and one of its partial interface's member's")
+    harness.ok(
+        threw, "[SecureContext] must not appear on an interface and one of its partial interface's member's")  # NOQA: E501
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [SecureContext]
             interface TestSecureContextOnInheritedInterface {
             };
             interface TestSecureContextNotOnInheritingInterface : TestSecureContextOnInheritedInterface {
               void testSecureMethod(byte foo);
             };
-        """)
+        """)  # NOQA: E501
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
-    harness.ok(threw, "[SecureContext] must appear on interfaces that inherit from another [SecureContext] interface")
+    harness.ok(
+        threw, "[SecureContext] must appear on interfaces that inherit from another [SecureContext] interface")  # NOQA: E501
 
     # Test 'implements'. The behavior tested here may have to change depending
     # on the resolution of https://github.com/heycam/webidl/issues/118
     parser = parser.reset()
     parser.parse("""
         [SecureContext]
         interface TestSecureContextInterfaceThatImplementsNonSecureContextInterface {
           const octet TEST_CONSTANT = 0;
         };
         interface TestNonSecureContextInterface {
           const octet TEST_CONSTANT_2 = 0;
           readonly attribute byte testAttribute2;
           void testMethod2(byte foo);
         };
         TestSecureContextInterfaceThatImplementsNonSecureContextInterface implements TestNonSecureContextInterface;
-     """)
+     """)  # NOQA: E501
     results = parser.finish()
-    harness.check(len(results[0].members), 4, "TestSecureContextInterfaceThatImplementsNonSecureContextInterface should have two members")
+    harness.check(len(results[0].members), 4,
+                  "TestSecureContextInterfaceThatImplementsNonSecureContextInterface should have two members")  # NOQA: E501
     harness.ok(results[0].getExtendedAttribute("SecureContext"),
                "Interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext"),
-               "[SecureContext] should propagate from interface to constant members even when other members are copied from a non-[SecureContext] interface")
+               "[SecureContext] should propagate from interface to constant members even when other members are copied from a non-[SecureContext] interface")  # NOQA: E501
     harness.ok(results[0].members[1].getExtendedAttribute("SecureContext") is None,
                "Constants copied from non-[SecureContext] interface should not be [SecureContext]")
     harness.ok(results[0].members[2].getExtendedAttribute("SecureContext") is None,
-               "Attributes copied from non-[SecureContext] interface should not be [SecureContext]")
+               "Attributes copied from non-[SecureContext] interface should not be [SecureContext]")  # NOQA: E501
     harness.ok(results[0].members[3].getExtendedAttribute("SecureContext") is None,
                "Methods copied from non-[SecureContext] interface should not be [SecureContext]")
- 
+
     # Test SecureContext and NoInterfaceObject
     parser = parser.reset()
     parser.parse("""
         [NoInterfaceObject, SecureContext]
         interface TestSecureContextNoInterfaceObject {
           void testSecureMethod(byte foo);
         };
     """)
     results = parser.finish()
-    harness.check(len(results[0].members), 1, "TestSecureContextNoInterfaceObject should have only one member")
+    harness.check(len(results[0].members), 1,
+                  "TestSecureContextNoInterfaceObject should have only one member")
     harness.ok(results[0].getExtendedAttribute("SecureContext"),
-      "Interface should have [SecureContext] extended attribute")
+               "Interface should have [SecureContext] extended attribute")
     harness.ok(results[0].members[0].getExtendedAttribute("SecureContext"),
-      "Interface member should have [SecureContext] extended attribute")
+               "Interface member should have [SecureContext] extended attribute")
--- a/dom/bindings/parser/tests/test_special_method_signature_mismatch.py
+++ b/dom/bindings/parser/tests/test_special_method_signature_mismatch.py
@@ -2,223 +2,223 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch1 {
               getter long long foo(long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch2 {
               getter void foo(unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch3 {
               getter boolean foo(unsigned long index, boolean extraArg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch4 {
               getter boolean foo(unsigned long... index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch5 {
               getter boolean foo(optional unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch6 {
               getter boolean foo();
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch7 {
               deleter long long foo(long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch9 {
               deleter boolean foo(unsigned long index, boolean extraArg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch10 {
               deleter boolean foo(unsigned long... index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch11 {
               deleter boolean foo(optional unsigned long index);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch12 {
               deleter boolean foo();
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch13 {
               setter long long foo(long index, long long value);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch15 {
               setter boolean foo(unsigned long index, boolean value, long long extraArg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch16 {
               setter boolean foo(unsigned long index, boolean... value);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch17 {
               setter boolean foo(unsigned long index, optional boolean value);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodSignatureMismatch18 {
               setter boolean foo();
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_special_methods.py
+++ b/dom/bindings/parser/tests/test_special_methods.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface SpecialMethods {
           getter long long (unsigned long index);
           setter long long (unsigned long index, long long value);
           getter boolean (DOMString name);
           setter boolean (DOMString name, boolean value);
           deleter boolean (DOMString name);
@@ -24,18 +25,20 @@ def WebIDLTest(parser, harness):
         harness.ok(isinstance(method, WebIDL.IDLMethod),
                    "Should be an IDLMethod")
         harness.check(method.identifier.QName(), QName, "Method has the right QName")
         harness.check(method.identifier.name, name, "Method has the right name")
         harness.check(method.isStatic(), static, "Method has the correct static value")
         harness.check(method.isGetter(), getter, "Method has the correct getter value")
         harness.check(method.isSetter(), setter, "Method has the correct setter value")
         harness.check(method.isDeleter(), deleter, "Method has the correct deleter value")
-        harness.check(method.isLegacycaller(), legacycaller, "Method has the correct legacycaller value")
-        harness.check(method.isStringifier(), stringifier, "Method has the correct stringifier value")
+        harness.check(method.isLegacycaller(), legacycaller,
+                      "Method has the correct legacycaller value")
+        harness.check(method.isStringifier(), stringifier,
+                      "Method has the correct stringifier value")
 
     harness.check(len(results), 2, "Expect 2 interfaces")
 
     iface = results[0]
     harness.check(len(iface.members), 6, "Expect 6 members")
 
     checkMethod(iface.members[0], "::SpecialMethods::__indexedgetter", "__indexedgetter",
                 getter=True)
@@ -49,25 +52,23 @@ def WebIDLTest(parser, harness):
                 deleter=True)
 
     iface = results[1]
     harness.check(len(iface.members), 1, "Expect 1 member")
 
     checkMethod(iface.members[0], "::SpecialMethodsCombination::__namedgetterdeleter",
                 "__namedgetterdeleter", getter=True, deleter=True)
 
-    parser = parser.reset();
+    parser = parser.reset()
 
     threw = False
     try:
         parser.parse(
             """
             interface IndexedDeleter {
               deleter void(unsigned long index);
             };
             """)
         parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "There are no indexed deleters")
-        
-        
--- a/dom/bindings/parser/tests/test_special_methods_uniqueness.py
+++ b/dom/bindings/parser/tests/test_special_methods_uniqueness.py
@@ -1,47 +1,45 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodUniqueness1 {
               getter deleter boolean (DOMString name);
               getter boolean (DOMString name);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodUniqueness1 {
               deleter boolean (DOMString name);
               getter deleter boolean (DOMString name);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     threw = False
     try:
         parser.parse("""
             interface SpecialMethodUniqueness1 {
               setter boolean (DOMString name);
               setter boolean (DOMString name);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_stringifier.py
+++ b/dom/bindings/parser/tests/test_stringifier.py
@@ -1,10 +1,11 @@
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestStringifier {
           stringifier;
         };
     """)
 
     results = parser.finish()
@@ -18,29 +19,28 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
             interface TestStringifier {
               stringifier;
               stringifier;
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow two 'stringifier;'")
 
     parser = parser.reset()
 
     threw = False
     try:
         parser.parse("""
             interface TestStringifier {
               stringifier;
               stringifier DOMString foo();
             };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should not allow a 'stringifier;' and a 'stringifier()'")
-
--- a/dom/bindings/parser/tests/test_toJSON.py
+++ b/dom/bindings/parser/tests/test_toJSON.py
@@ -2,100 +2,100 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               object toJSON();
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(not threw, "Should allow a toJSON method.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               object toJSON(object arg);
               object toJSON(long arg);
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow overloads of a toJSON method.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               object toJSON(object arg);
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow a toJSON method with arguments.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               long toJSON();
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(not threw, "Should allow a toJSON method with 'long' as return type.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               [Default] object toJSON();
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(not threw, "Should allow a default toJSON method with 'object' as return type.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               [Default] long toJSON();
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow a default toJSON method with non-'object' as return type.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse(
             """
             interface Test {
               any toJSON();
             };
             """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
     harness.ok(threw, "Should not allow a toJSON method with a non-JSON return type.")
 
     # We should probably write some tests here about what types are
     # considered JSON types.  Bug 1462537.
--- a/dom/bindings/parser/tests/test_treatNonCallableAsNull.py
+++ b/dom/bindings/parser/tests/test_treatNonCallableAsNull.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         [TreatNonCallableAsNull] callback Function = any(any... arguments);
 
         interface TestTreatNonCallableAsNull1 {
           attribute Function? onfoo;
           attribute Function onbar;
         };
@@ -26,17 +24,17 @@ def WebIDLTest(parser, harness):
             callback Function = any(any... arguments);
 
             interface TestTreatNonCallableAsNull2 {
               [TreatNonCallableAsNull] attribute Function onfoo;
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
 
     threw = False
     try:
@@ -45,27 +43,27 @@ def WebIDLTest(parser, harness):
 
             [TreatNonCallableAsNull]
             interface TestTreatNonCallableAsNull3 {
                attribute Function onfoo;
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
 
     threw = False
     try:
         parser.parse("""
             [TreatNonCallableAsNull, TreatNonObjectAsNull]
             callback Function = any(any... arguments);
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_typedef.py
+++ b/dom/bindings/parser/tests/test_typedef.py
@@ -20,47 +20,47 @@ def WebIDLTest(parser, harness):
     try:
         parser.parse("""
           typedef long? mynullablelong;
           interface Foo {
             void foo(mynullablelong? Y);
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on nullable inside nullable arg.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           typedef long? mynullablelong;
           interface Foo {
             const mynullablelong? X = 5;
           };
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on nullable inside nullable const.")
-    
+
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
           interface Foo {
             const mynullablelong? X = 5;
           };
           typedef long? mynullablelong;
         """)
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown on nullable inside nullable const typedef "
                "after interface.")
 
     parser = parser.reset()
     parser.parse("""
--- a/dom/bindings/parser/tests/test_unenumerable_own_properties.py
+++ b/dom/bindings/parser/tests/test_unenumerable_own_properties.py
@@ -5,46 +5,46 @@ def WebIDLTest(parser, harness):
         interface Foo {};
         [LegacyUnenumerableNamedProperties]
         interface Bar : Foo {
           getter long(DOMString name);
         };
         interface Baz : Bar {
           getter long(DOMString name);
         };
-        """);
-    results = parser.finish();
+        """)
+    results = parser.finish()
     harness.check(len(results), 3, "Should have three interfaces")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [LegacyUnenumerableNamedProperties]
             interface NoNamedGetter {
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [LegacyUnenumerableNamedProperties=Foo]
             interface ShouldNotHaveArg {
               getter long(DOMString name);
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             [LegacyUnenumerableNamedProperties]
@@ -54,11 +54,11 @@ def WebIDLTest(parser, harness):
             interface Bar : Foo {};
             [LegacyUnenumerableNamedProperties]
             interface Baz : Bar {
               getter long(DOMString name);
             };
         """)
 
         results = parser.finish()
-    except Exception, x:
+    except Exception:
         threw = True
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_unforgeable.py
+++ b/dom/bindings/parser/tests/test_unforgeable.py
@@ -7,179 +7,179 @@ def WebIDLTest(parser, harness):
             };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2,
                   "Should be able to inherit from an interface with "
                   "[Unforgeable] properties.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
             interface Child : Parent {
               const short foo = 10;
             };
             interface Parent {
               [Unforgeable] readonly attribute long foo;
             };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2,
                   "Should be able to inherit from an interface with "
                   "[Unforgeable] properties even if we have a constant with "
                   "the same name.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
             interface Child : Parent {
               static attribute short foo;
             };
             interface Parent {
               [Unforgeable] readonly attribute long foo;
             };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2,
                   "Should be able to inherit from an interface with "
                   "[Unforgeable] properties even if we have a static attribute "
                   "with the same name.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
             interface Child : Parent {
               static void foo();
             };
             interface Parent {
               [Unforgeable] readonly attribute long foo;
             };
         """)
 
     results = parser.finish()
     harness.check(len(results), 2,
                   "Should be able to inherit from an interface with "
                   "[Unforgeable] properties even if we have a static operation "
                   "with the same name.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
               void foo();
             };
             interface Parent {
               [Unforgeable] readonly attribute long foo;
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should have thrown when shadowing unforgeable attribute on "
                "parent with operation.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
               void foo();
             };
             interface Parent {
               [Unforgeable] void foo();
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should have thrown when shadowing unforgeable operation on "
                "parent with operation.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
               attribute short foo;
             };
             interface Parent {
               [Unforgeable] readonly attribute long foo;
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should have thrown when shadowing unforgeable attribute on "
                "parent with attribute.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
               attribute short foo;
             };
             interface Parent {
               [Unforgeable] void foo();
             };
         """)
 
         results = parser.finish()
-    except Exception,x:
+    except Exception:
         threw = True
     harness.ok(threw,
                "Should have thrown when shadowing unforgeable operation on "
                "parent with attribute.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
             interface Child : Parent {
             };
             interface Parent {};
             interface Consequential {
               [Unforgeable] readonly attribute long foo;
             };
             Parent implements Consequential;
         """)
 
     results = parser.finish()
     harness.check(len(results), 4,
                   "Should be able to inherit from an interface with a "
                   "consequential interface with [Unforgeable] properties.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
               void foo();
             };
             interface Parent {};
             interface Consequential {
               [Unforgeable] readonly attribute long foo;
             };
             Parent implements Consequential;
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown when shadowing unforgeable attribute "
                "of parent's consequential interface.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
             };
             interface Parent : GrandParent {};
             interface GrandParent {};
             interface Consequential {
@@ -188,24 +188,24 @@ def WebIDLTest(parser, harness):
             GrandParent implements Consequential;
             interface ChildConsequential {
               void foo();
             };
             Child implements ChildConsequential;
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown when our consequential interface shadows unforgeable attribute "
                "of ancestor's consequential interface.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface Child : Parent {
             };
             interface Parent : GrandParent {};
             interface GrandParent {};
             interface Consequential {
@@ -214,40 +214,40 @@ def WebIDLTest(parser, harness):
             GrandParent implements Consequential;
             interface ChildConsequential {
               void foo();
             };
             Child implements ChildConsequential;
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown when our consequential interface shadows unforgeable operation "
                "of ancestor's consequential interface.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     parser.parse("""
         interface iface {
           [Unforgeable] attribute long foo;
         };
     """)
 
     results = parser.finish()
     harness.check(len(results), 1,
                   "Should allow writable [Unforgeable] attribute.")
 
-    parser = parser.reset();
+    parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface iface {
               [Unforgeable] static readonly attribute long foo;
             };
         """)
 
         results = parser.finish()
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown for static [Unforgeable] attribute.")
--- a/dom/bindings/parser/tests/test_union.py
+++ b/dom/bindings/parser/tests/test_union.py
@@ -1,20 +1,22 @@
-import WebIDL
-import itertools
 import string
 
 # We'd like to use itertools.chain but it's 2.6 or higher.
+
+
 def chain(*iterables):
     # chain('ABC', 'DEF') --> A B C D E F
     for it in iterables:
         for element in it:
             yield element
 
 # We'd like to use itertools.combinations but it's 2.6 or higher.
+
+
 def combinations(iterable, r):
     # combinations('ABCD', 2) --> AB AC AD BC BD CD
     # combinations(range(4), 3) --> 012 013 023 123
     pool = tuple(iterable)
     n = len(pool)
     if r > n:
         return
     indices = range(r)
@@ -27,16 +29,18 @@ def combinations(iterable, r):
             return
         indices[i] += 1
         for j in range(i+1, r):
             indices[j] = indices[j-1] + 1
         yield tuple(pool[i] for i in indices)
 
 # We'd like to use itertools.combinations_with_replacement but it's 2.7 or
 # higher.
+
+
 def combinations_with_replacement(iterable, r):
     # combinations_with_replacement('ABC', 2) --> AA AB AC BB BC CC
     pool = tuple(iterable)
     n = len(pool)
     if not n and r:
         return
     indices = [0] * r
     yield tuple(pool[i] for i in indices)
@@ -44,35 +48,36 @@ def combinations_with_replacement(iterab
         for i in reversed(range(r)):
             if indices[i] != n - 1:
                 break
         else:
             return
         indices[i:] = [indices[i] + 1] * (r - i)
         yield tuple(pool[i] for i in indices)
 
+
 def WebIDLTest(parser, harness):
     types = ["float",
              "double",
              "short",
              "unsigned short",
              "long",
              "unsigned long",
              "long long",
              "unsigned long long",
              "boolean",
              "byte",
              "octet",
              "DOMString",
              "ByteString",
              "USVString",
-             #"sequence<float>",
+             # "sequence<float>",
              "object",
              "ArrayBuffer",
-             #"Date",
+             # "Date",
              "TestInterface1",
              "TestInterface2"]
 
     testPre = """
         interface TestInterface1 {
         };
         interface TestInterface2 {
         };
@@ -93,18 +98,20 @@ def WebIDLTest(parser, harness):
     results = parser.finish()
 
     iface = results[2]
 
     parser = parser.reset()
 
     def typesAreDistinguishable(t):
         return all(u[0].isDistinguishableFrom(u[1]) for u in combinations(t, 2))
+
     def typesAreNotDistinguishable(t):
         return any(not u[0].isDistinguishableFrom(u[1]) for u in combinations(t, 2))
+
     def unionTypeName(t):
         if len(t) > 2:
             t[0:2] = [unionTypeName(t[0:2])]
         return "(" + " or ".join(t) + ")"
 
     # typeCombinations is an iterable of tuples containing the name of the type
     # as a string and the parsed IDL type.
     def unionTypes(typeCombinations, predicate):
@@ -124,17 +131,18 @@ def WebIDLTest(parser, harness):
                 yield unionTypeName([t[0] for t in c])
 
     # Create a list of tuples containing the name of the type as a string and
     # the parsed IDL type.
     types = zip(types, (a.type for a in iface.members))
 
     validUnionTypes = chain(unionTypes(combinations(types, 2), typesAreDistinguishable),
                             unionTypes(combinations(types, 3), typesAreDistinguishable))
-    invalidUnionTypes = chain(unionTypes(combinations_with_replacement(types, 2), typesAreNotDistinguishable),
+    invalidUnionTypes = chain(unionTypes(combinations_with_replacement(types, 2),
+                                         typesAreNotDistinguishable),
                               invalidUnionWithUnion(combinations(types, 3)))
     interface = testPre + """
         interface TestUnion {
         """
     for (i, type) in enumerate(validUnionTypes):
         interface += string.Template("""
           void method${i}(${type} arg);
           ${type} returnMethod${i}();
@@ -155,14 +163,14 @@ def WebIDLTest(parser, harness):
               void method(${type} arg);
             };
         """).substitute(type=invalid)
 
         threw = False
         try:
             parser.parse(interface)
             results = parser.finish()
-        except:
+        except Exception:
             threw = True
 
         harness.ok(threw, "Should have thrown.")
 
         parser = parser.reset()
--- a/dom/bindings/parser/tests/test_union_any.py
+++ b/dom/bindings/parser/tests/test_union_any.py
@@ -2,13 +2,13 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface AnyNotInUnion {
               void foo((any or DOMString) arg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown.")
--- a/dom/bindings/parser/tests/test_union_nullable.py
+++ b/dom/bindings/parser/tests/test_union_nullable.py
@@ -2,35 +2,35 @@ def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface OneNullableInUnion {
               void foo((object? or DOMString?) arg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Two nullable member types of a union should have thrown.")
 
     parser.reset()
     threw = False
 
     try:
         parser.parse("""
             interface NullableInNullableUnion {
               void foo((object? or DOMString)? arg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "A nullable union type with a nullable member type should have "
                "thrown.")
 
     parser.reset()
     threw = False
@@ -39,15 +39,15 @@ def WebIDLTest(parser, harness):
         parser.parse("""
             interface NullableInUnionNullableUnionHelper {
             };
             interface NullableInUnionNullableUnion {
               void foo(((object? or DOMString) or NullableInUnionNullableUnionHelper)? arg);
             };
         """)
 
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "A nullable union type with a nullable member type should have "
                "thrown.")
--- a/dom/bindings/parser/tests/test_usvstring.py
+++ b/dom/bindings/parser/tests/test_usvstring.py
@@ -1,20 +1,21 @@
 # -*- coding: UTF-8 -*-
 
 import WebIDL
 
+
 def WebIDLTest(parser, harness):
     parser.parse("""
         interface TestUSVString {
           attribute USVString svs;
         };
     """)
 
-    results = parser.finish();
+    results = parser.finish()
 
     harness.check(len(results), 1, "Should be one production")
     harness.ok(isinstance(results[0], WebIDL.IDLInterface),
                "Should be an IDLInterface")
     iface = results[0]
     harness.check(iface.identifier.QName(), "::TestUSVString",
                   "Interface has the right QName")
     harness.check(iface.identifier.name, "TestUSVString",
--- a/dom/bindings/parser/tests/test_variadic_callback.py
+++ b/dom/bindings/parser/tests/test_variadic_callback.py
@@ -1,10 +1,8 @@
-import WebIDL
-
 def WebIDLTest(parser, harness):
     parser.parse("""
         callback TestVariadicCallback = any(any... arguments);
     """)
 
-    results = parser.finish()
+    parser.finish()
 
     harness.ok(True, "TestVariadicCallback callback parsed without error.")
--- a/dom/bindings/parser/tests/test_variadic_constraints.py
+++ b/dom/bindings/parser/tests/test_variadic_constraints.py
@@ -1,63 +1,63 @@
 def WebIDLTest(parser, harness):
     threw = False
     try:
         parser.parse("""
             interface VariadicConstraints1 {
               void foo(byte... arg1, byte arg2);
             };
         """)
-        results = parser.finish()
+        parser.finish()
 
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown on variadic argument followed by required "
                "argument.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface VariadicConstraints2 {
               void foo(byte... arg1, optional byte arg2);
             };
         """)
-        results = parser.finish();
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown on variadic argument followed by optional "
                "argument.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface VariadicConstraints3 {
               void foo(optional byte... arg1);
             };
         """)
-        results = parser.finish()
+        parser.finish()
 
-    except:
+    except Exception:
         threw = True
 
     harness.ok(threw,
                "Should have thrown on variadic argument explicitly flagged as "
                "optional.")
 
     parser = parser.reset()
     threw = False
     try:
         parser.parse("""
             interface VariadicConstraints4 {
               void foo(byte... arg1 = 0);
             };
         """)
-        results = parser.finish()
-    except:
+        parser.finish()
+    except Exception:
         threw = True
 
     harness.ok(threw, "Should have thrown on variadic argument with default value.")
--- a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/process-ogles2-tests.py
@@ -7,18 +7,18 @@ import os.path
 import sys
 import re
 import json
 import shutil
 from optparse import OptionParser
 from xml.dom.minidom import parse
 
 if sys.version < '2.6':
-   print 'Wrong Python Version !!!: Need >= 2.6'
-   sys.exit(1)
+    print 'Wrong Python Version !!!: Need >= 2.6'
+    sys.exit(1)
 
 # each shader test generates up to 3 512x512 images.
 # a 512x512 image takes 1meg of memory so set this
 # number apporpriate for the platform with
 # the smallest memory issue. At 8 that means
 # at least 24 meg is needed to run the test.
 MAX_TESTS_PER_SET = 8
 
@@ -94,276 +94,278 @@ VALID_UNIFORM_TYPES = [
 
 SUBSTITUTIONS = [
   ("uniformmat3fv", "uniformMatrix3fv"),
   ("uniformmat4fv", "uniformMatrix4fv"),
 ]
 
 
 def Log(msg):
-  global VERBOSE
-  if VERBOSE:
-    print msg
+    global VERBOSE
+    if VERBOSE:
+        print msg
 
 
 def TransposeMatrix(values, dim):
-  size = dim * dim
-  count = len(values) / size
-  for m in range(0, count):
-    offset = m * size
-    for i in range(0, dim):
-      for j in range(i + 1, dim):
-        t = values[offset + i * dim + j]
-        values[offset + i * dim + j] = values[offset + j * dim + i]
-        values[offset + j * dim + i] = t
+    size = dim * dim
+    count = len(values) / size
+    for m in range(0, count):
+        offset = m * size
+        for i in range(0, dim):
+            for j in range(i + 1, dim):
+                t = values[offset + i * dim + j]
+                values[offset + i * dim + j] = values[offset + j * dim + i]
+                values[offset + j * dim + i] = t
 
 
 def GetValidTypeName(type_name):
-  global VALID_UNIFORM_TYPES
-  global SUBSTITUTIONS
-  for subst in SUBSTITUTIONS:
-    type_name = type_name.replace(subst[0], subst[1])
-  if not type_name in VALID_UNIFORM_TYPES:
-    print "unknown type name: ", type_name
-    raise SyntaxError
-  return type_name
+    global VALID_UNIFORM_TYPES
+    global SUBSTITUTIONS
+    for subst in SUBSTITUTIONS:
+        type_name = type_name.replace(subst[0], subst[1])
+    if type_name not in VALID_UNIFORM_TYPES:
+        print("unknown type name: ", type_name)
+        raise SyntaxError
+    return type_name
 
 
 def WriteOpen(filename):
-  dirname = os.path.dirname(filename)
-  if len(dirname) > 0 and not os.path.exists(dirname):
-    os.makedirs(dirname)
-  return open(filename, "wb")
+    dirname = os.path.dirname(filename)
+    if len(dirname) > 0 and not os.path.exists(dirname):
+        os.makedirs(dirname)
+    return open(filename, "wb")
 
 
 class TxtWriter():
-  def __init__(self, filename):
-    self.filename = filename
-    self.lines = []
+    def __init__(self, filename):
+        self.filename = filename
+        self.lines = []
 
-  def Write(self, line):
-    self.lines.append(line)
+    def Write(self, line):
+        self.lines.append(line)
 
-  def Close(self):
-    if len(self.lines) > 0:
-      Log("Writing: %s" % self.filename)
-      f = WriteOpen(self.filename)
-      f.write("# this file is auto-generated. DO NOT EDIT.\n")
-      f.write("".join(self.lines))
-      f.close()
+    def Close(self):
+        if len(self.lines) > 0:
+            Log("Writing: %s" % self.filename)
+            f = WriteOpen(self.filename)
+            f.write("# this file is auto-generated. DO NOT EDIT.\n")
+            f.write("".join(self.lines))
+            f.close()
 
 
 def ReadFileAsLines(filename):
-  f = open(filename, "r")
-  lines = f.readlines()
-  f.close()
-  return [line.strip() for line in lines]
+    f = open(filename, "r")
+    lines = f.readlines()
+    f.close()
+    return [line.strip() for line in lines]
 
 
 def ReadFile(filename):
-  f = open(filename, "r")
-  content = f.read()
-  f.close()
-  return content.replace("\r\n", "\n")
+    f = open(filename, "r")
+    content = f.read()
+    f.close()
+    return content.replace("\r\n", "\n")
 
 
 def Chunkify(list, chunk_size):
-  """divides an array into chunks of chunk_size"""
-  return [list[i:i + chunk_size] for i in range(0, len(list), chunk_size)]
+    """divides an array into chunks of chunk_size"""
+    return [list[i:i + chunk_size] for i in range(0, len(list), chunk_size)]
 
 
 def GetText(nodelist):
-  """Gets the text of from a list of nodes"""
-  rc = []
-  for node in nodelist:
-    if node.nodeType == node.TEXT_NODE:
-      rc.append(node.data)
-  return ''.join(rc)
+    """Gets the text of from a list of nodes"""
+    rc = []
+    for node in nodelist:
+        if node.nodeType == node.TEXT_NODE:
+            rc.append(node.data)
+    return ''.join(rc)
 
 
 def GetElementText(node, name):
-  """Gets the text of an element"""
-  elements = node.getElementsByTagName(name)
-  if len(elements) > 0:
-    return GetText(elements[0].childNodes)
-  else:
-    return None
+    """Gets the text of an element"""
+    elements = node.getElementsByTagName(name)
+    if len(elements) > 0:
+        return GetText(elements[0].childNodes)
+    else:
+        return None
 
 
 def GetBoolElement(node, name):
-  text = GetElementText(node, name)
-  return text.lower() == "true"
+    text = GetElementText(node, name)
+    return text.lower() == "true"
 
 
 def GetModel(node):
-  """Gets the model"""
-  model = GetElementText(node, "model")
-  if model and len(model.strip()) == 0:
-    elements = node.getElementsByTagName("model")
-    if len(elements) > 0:
-      model = GetElementText(elements[0], "filename")
-  return model
+    """Gets the model"""
+    model = GetElementText(node, "model")
+    if model and len(model.strip()) == 0:
+        elements = node.getElementsByTagName("model")
+        if len(elements) > 0:
+            model = GetElementText(elements[0], "filename")
+    return model
 
 
 def RelativizePaths(base, paths, template):
-  """converts paths to relative paths"""
-  rels = []
-  for p in paths:
-    #print "---"
-    #print "base: ", os.path.abspath(base)
-    #print "path: ", os.path.abspath(p)
-    relpath = os.path.relpath(os.path.abspath(p), os.path.dirname(os.path.abspath(base))).replace("\\", "/")
-    #print "rel : ", relpath
-    rels.append(template % relpath)
-  return "\n".join(rels)
+    """converts paths to relative paths"""
+    rels = []
+    for p in paths:
+        # print "---"
+        # print "base: ", os.path.abspath(base)
+        # print "path: ", os.path.abspath(p)
+        relpath = os.path.relpath(os.path.abspath(p), os.path.dirname(
+            os.path.abspath(base))).replace("\\", "/")
+        # print "rel : ", relpath
+        rels.append(template % relpath)
+    return "\n".join(rels)
 
 
 def CopyFile(filename, src, dst):
-  s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
-  d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
-  dst_dir = os.path.dirname(d)
-  if not os.path.exists(dst_dir):
-    os.makedirs(dst_dir)
-  shutil.copyfile(s, d)
+    s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
+    d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
+    dst_dir = os.path.dirname(d)
+    if not os.path.exists(dst_dir):
+        os.makedirs(dst_dir)
+    shutil.copyfile(s, d)
 
 
 def CopyShader(filename, src, dst):
-  s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
-  d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
-  text = ReadFile(s)
-  # By agreement with the Khronos OpenGL working group we are allowed
-  # to open source only the .vert and .frag files from the OpenGL ES 2.0
-  # conformance tests. All other files from the OpenGL ES 2.0 conformance
-  # tests are not included.
-  marker = "insert-copyright-here"
-  new_text = COMMENT_RE.sub(marker, text)
-  if new_text == text:
-    print "no matching license found:", s
-    raise RuntimeError
-  new_text = REMOVE_COPYRIGHT_RE.sub("", new_text)
-  new_text = new_text.replace(marker, LICENSE)
-  f = WriteOpen(d)
-  f.write(new_text)
-  f.close()
+    s = os.path.abspath(os.path.join(os.path.dirname(src), filename))
+    d = os.path.abspath(os.path.join(os.path.dirname(dst), filename))
+    text = ReadFile(s)
+    # By agreement with the Khronos OpenGL working group we are allowed
+    # to open source only the .vert and .frag files from the OpenGL ES 2.0
+    # conformance tests. All other files from the OpenGL ES 2.0 conformance
+    # tests are not included.
+    marker = "insert-copyright-here"
+    new_text = COMMENT_RE.sub(marker, text)
+    if new_text == text:
+        print "no matching license found:", s
+        raise RuntimeError
+    new_text = REMOVE_COPYRIGHT_RE.sub("", new_text)
+    new_text = new_text.replace(marker, LICENSE)
+    f = WriteOpen(d)
+    f.write(new_text)
+    f.close()
 
 
 def IsOneOf(string, regexs):
-  for regex in regexs:
-    if re.match(regex, string):
-      return True
-  return False
+    for regex in regexs:
+        if re.match(regex, string):
+            return True
+    return False
 
 
 def CheckForUnknownTags(valid_tags, node, depth=1):
-  """do a hacky check to make sure we're not missing something."""
-  for child in node.childNodes:
-    if child.localName and not IsOneOf(child.localName, valid_tags[0]):
-      print "unsupported tag:", child.localName
-      print "depth:", depth
-      raise SyntaxError
-    else:
-      if len(valid_tags) > 1:
-        CheckForUnknownTags(valid_tags[1:], child, depth + 1)
+    """do a hacky check to make sure we're not missing something."""
+    for child in node.childNodes:
+        if child.localName and not IsOneOf(child.localName, valid_tags[0]):
+            print "unsupported tag:", child.localName
+            print "depth:", depth
+            raise SyntaxError
+        else:
+            if len(valid_tags) > 1:
+                CheckForUnknownTags(valid_tags[1:], child, depth + 1)
 
 
 def IsFileWeWant(filename):
-  for f in FILTERS:
-    if f.search(filename):
-      return True
-  return False
+    for f in FILTERS:
+        if f.search(filename):
+            return True
+    return False
 
 
 class TestReader():
-  """class to read and parse tests"""
+    """class to read and parse tests"""
 
-  def __init__(self, basepath):
-    self.tests = []
-    self.modes = {}
-    self.patterns = {}
-    self.basepath = basepath
+    def __init__(self, basepath):
+        self.tests = []
+        self.modes = {}
+        self.patterns = {}
+        self.basepath = basepath
 
-  def Print(self, msg):
-    if self.verbose:
-      print msg
+    def Print(self, msg):
+        if self.verbose:
+            print msg
 
-  def MakeOutPath(self, filename):
-    relpath = os.path.relpath(os.path.abspath(filename), os.path.dirname(os.path.abspath(self.basepath)))
-    return relpath
+    def MakeOutPath(self, filename):
+        relpath = os.path.relpath(os.path.abspath(
+            filename), os.path.dirname(os.path.abspath(self.basepath)))
+        return relpath
 
-  def ReadTests(self, filename):
-    """reads a .run file and parses."""
-    Log("reading %s" % filename)
-    outname = self.MakeOutPath(filename + ".txt")
-    f = TxtWriter(outname)
-    dirname = os.path.dirname(filename)
-    lines = ReadFileAsLines(filename)
-    count = 0
-    tests_data = []
-    for line in lines:
-      if len(line) > 0 and not line.startswith("#"):
-        fname = os.path.join(dirname, line)
-        if line.endswith(".run"):
-          if self.ReadTests(fname):
-            f.Write(line + ".txt\n")
+    def ReadTests(self, filename):
+        """reads a .run file and parses."""
+        Log("reading %s" % filename)
+        outname = self.MakeOutPath(filename + ".txt")
+        f = TxtWriter(outname)
+        dirname = os.path.dirname(filename)
+        lines = ReadFileAsLines(filename)
+        count = 0
+        tests_data = []
+        for line in lines:
+            if len(line) > 0 and not line.startswith("#"):
+                fname = os.path.join(dirname, line)
+                if line.endswith(".run"):
+                    if self.ReadTests(fname):
+                        f.Write(line + ".txt\n")
+                        count += 1
+                elif line.endswith(".test"):
+                    tests_data.extend(self.ReadTest(fname))
+                else:
+                    print "Error in %s:%d:%s" % (filename, count, line)
+                    raise SyntaxError()
+        if len(tests_data):
+            global MAX_TESTS_PER_SET
+            sets = Chunkify(tests_data, MAX_TESTS_PER_SET)
+            id = 1
+            for set in sets:
+                suffix = "_%03d_to_%03d" % (id, id + len(set) - 1)
+                test_outname = self.MakeOutPath(filename + suffix + ".html")
+                if os.path.basename(test_outname).startswith("input.run"):
+                    dname = os.path.dirname(test_outname)
+                    folder_name = os.path.basename(dname)
+                    test_outname = os.path.join(dname, folder_name + suffix + ".html")
+                self.WriteTests(filename, test_outname, {"tests": set})
+                f.Write(os.path.basename(test_outname) + "\n")
+                id += len(set)
             count += 1
-        elif line.endswith(".test"):
-          tests_data.extend(self.ReadTest(fname))
-        else:
-          print "Error in %s:%d:%s" % (filename, count, line)
-          raise SyntaxError()
-    if len(tests_data):
-      global MAX_TESTS_PER_SET
-      sets = Chunkify(tests_data, MAX_TESTS_PER_SET)
-      id = 1
-      for set in sets:
-        suffix = "_%03d_to_%03d" % (id, id + len(set) - 1)
-        test_outname = self.MakeOutPath(filename + suffix + ".html")
-        if os.path.basename(test_outname).startswith("input.run"):
-          dname = os.path.dirname(test_outname)
-          folder_name = os.path.basename(dname)
-          test_outname = os.path.join(dname, folder_name + suffix + ".html")
-        self.WriteTests(filename, test_outname, {"tests":set})
-        f.Write(os.path.basename(test_outname) + "\n")
-        id += len(set)
-      count += 1
-    f.Close()
-    return count
+        f.Close()
+        return count
 
-  def ReadTest(self, filename):
-    """reads a .test file and parses."""
-    Log("reading %s" % filename)
-    dom = parse(filename)
-    tests = dom.getElementsByTagName("test")
-    tests_data = []
-    outname = self.MakeOutPath(filename + ".html")
-    for test in tests:
-      if not IsFileWeWant(filename):
-        self.CopyShaders(test, filename, outname)
-      else:
-        test_data = self.ProcessTest(test, filename, outname, len(tests_data))
-        if test_data:
-          tests_data.append(test_data)
-    return tests_data
+    def ReadTest(self, filename):
+        """reads a .test file and parses."""
+        Log("reading %s" % filename)
+        dom = parse(filename)
+        tests = dom.getElementsByTagName("test")
+        tests_data = []
+        outname = self.MakeOutPath(filename + ".html")
+        for test in tests:
+            if not IsFileWeWant(filename):
+                self.CopyShaders(test, filename, outname)
+            else:
+                test_data = self.ProcessTest(test, filename, outname, len(tests_data))
+                if test_data:
+                    tests_data.append(test_data)
+        return tests_data
 
-  def ProcessTest(self, test, filename, outname, id):
-    """Process a test"""
-    mode = test.getAttribute("mode")
-    pattern = test.getAttribute("pattern")
-    self.modes[mode] = 1
-    self.patterns[pattern] = 1
-    Log ("%d: mode: %s pattern: %s" % (id, mode, pattern))
-    method = getattr(self, 'Process_' + pattern)
-    test_data = method(test, filename, outname)
-    if test_data:
-      test_data["pattern"] = pattern
-    return test_data
+    def ProcessTest(self, test, filename, outname, id):
+        """Process a test"""
+        mode = test.getAttribute("mode")
+        pattern = test.getAttribute("pattern")
+        self.modes[mode] = 1
+        self.patterns[pattern] = 1
+        Log("%d: mode: %s pattern: %s" % (id, mode, pattern))
+        method = getattr(self, 'Process_' + pattern)
+        test_data = method(test, filename, outname)
+        if test_data:
+            test_data["pattern"] = pattern
+        return test_data
 
-  def WriteTests(self, filename, outname, tests_data):
-    Log("Writing %s" % outname)
-    template = """<!DOCTYPE html>
+    def WriteTests(self, filename, outname, tests_data):
+        Log("Writing %s" % outname)
+        template = """<!DOCTYPE html>
 <!-- this file is auto-generated. DO NOT EDIT.
 %(license)s
 -->
 <html>
 <head>
 <meta charset="utf-8">
 <title>WebGL GLSL conformance test: %(title)s</title>
 %(css)s
@@ -376,211 +378,210 @@ class TestReader():
 </body>
 <script>
 "use strict";
 OpenGLESTestRunner.run(%(tests_data)s);
 var successfullyParsed = true;
 </script>
 </html>
 """
-    css = [
-      "../../resources/js-test-style.css",
-      "../../resources/ogles-tests.css",
-    ]
-    scripts = [
-      "../../resources/js-test-pre.js",
-      "../../resources/webgl-test-utils.js",
-      "ogles-utils.js",
-    ]
-    css_html = RelativizePaths(outname, css, '<link rel="stylesheet" href="%s" />')
-    scripts_html = RelativizePaths(outname, scripts, '<script src="%s"></script>')
+        css = [
+          "../../resources/js-test-style.css",
+          "../../resources/ogles-tests.css",
+        ]
+        scripts = [
+          "../../resources/js-test-pre.js",
+          "../../resources/webgl-test-utils.js",
+          "ogles-utils.js",
+        ]
+        css_html = RelativizePaths(outname, css, '<link rel="stylesheet" href="%s" />')
+        scripts_html = RelativizePaths(outname, scripts, '<script src="%s"></script>')
 
-    f = WriteOpen(outname)
-    f.write(template % {
-        "license": LICENSE,
-        "css": css_html,
-        "scripts": scripts_html,
-        "title": os.path.basename(outname),
-        "tests_data": json.dumps(tests_data, indent=2)
-      })
-    f.close()
-
+        f = WriteOpen(outname)
+        f.write(template % {
+            "license": LICENSE,
+            "css": css_html,
+            "scripts": scripts_html,
+            "title": os.path.basename(outname),
+            "tests_data": json.dumps(tests_data, indent=2)
+          })
+        f.close()
 
-  def CopyShaders(self, test, filename, outname):
-    """For tests we don't actually support yet, at least copy the shaders"""
-    shaders = test.getElementsByTagName("shader")
-    for shader in shaders:
-      for name in ["vertshader", "fragshader"]:
-        s = GetElementText(shader, name)
-        if s and s != "empty":
-          CopyShader(s, filename, outname)
+    def CopyShaders(self, test, filename, outname):
+        """For tests we don't actually support yet, at least copy the shaders"""
+        shaders = test.getElementsByTagName("shader")
+        for shader in shaders:
+            for name in ["vertshader", "fragshader"]:
+                s = GetElementText(shader, name)
+                if s and s != "empty":
+                    CopyShader(s, filename, outname)
 
-  #
-  # pattern handlers.
-  #
+    #
+    # pattern handlers.
+    #
 
-  def Process_compare(self, test, filename, outname):
-    global MATRIX_RE
+    def Process_compare(self, test, filename, outname):
+        global MATRIX_RE
 
-    valid_tags = [
-      ["shader", "model", "glstate"],
-      ["uniform", "vertshader", "fragshader", "filename", "depthrange"],
-      ["name", "count", "transpose", "uniform*", "near", "far"],
-    ]
-    CheckForUnknownTags(valid_tags, test)
+        valid_tags = [
+          ["shader", "model", "glstate"],
+          ["uniform", "vertshader", "fragshader", "filename", "depthrange"],
+          ["name", "count", "transpose", "uniform*", "near", "far"],
+        ]
+        CheckForUnknownTags(valid_tags, test)
 
-    # parse the test
-    shaders = test.getElementsByTagName("shader")
-    shaderInfos = []
-    for shader in shaders:
-      v = GetElementText(shader, "vertshader")
-      f = GetElementText(shader, "fragshader")
-      CopyShader(v, filename, outname)
-      CopyShader(f, filename, outname)
-      info = {
-        "vertexShader": v,
-        "fragmentShader": f,
-      }
-      shaderInfos.append(info)
-      uniformElems = shader.getElementsByTagName("uniform")
-      if len(uniformElems) > 0:
-        uniforms = {}
-        info["uniforms"] = uniforms
-        for uniformElem in uniformElems:
-          uniform = {"count": 1}
-          for child in uniformElem.childNodes:
-            if child.localName == None:
-              pass
-            elif child.localName == "name":
-              uniforms[GetText(child.childNodes)] = uniform
-            elif child.localName == "count":
-              uniform["count"] = int(GetText(child.childNodes))
-            elif child.localName == "transpose":
-              uniform["transpose"] = (GetText(child.childNodes) == "true")
-            else:
-              if "type" in uniform:
-                print "utype was:", uniform["type"], " found ", child.localName
-                raise SyntaxError
-              type_name = GetValidTypeName(child.localName)
-              uniform["type"] = type_name
-              valueText = GetText(child.childNodes).replace(",", " ")
-              uniform["value"] = [float(t) for t in valueText.split()]
-              m = MATRIX_RE.search(type_name)
-              if m:
-                # Why are these backward from the API?!?!?
-                TransposeMatrix(uniform["value"], int(m.group(1)))
-    data = {
-      "name": os.path.basename(outname),
-      "model": GetModel(test),
-      "referenceProgram": shaderInfos[1],
-      "testProgram": shaderInfos[0],
-    }
-    gl_states = test.getElementsByTagName("glstate")
-    if len(gl_states) > 0:
-      state = {}
-      data["state"] = state
-      for gl_state in gl_states:
-        for state_name in gl_state.childNodes:
-          if state_name.localName:
-            values = {}
-            for field in state_name.childNodes:
-              if field.localName:
-                values[field.localName] = GetText(field.childNodes)
-            state[state_name.localName] = values
-    return data
+        # parse the test
+        shaders = test.getElementsByTagName("shader")
+        shaderInfos = []
+        for shader in shaders:
+            v = GetElementText(shader, "vertshader")
+            f = GetElementText(shader, "fragshader")
+            CopyShader(v, filename, outname)
+            CopyShader(f, filename, outname)
+            info = {
+              "vertexShader": v,
+              "fragmentShader": f,
+            }
+            shaderInfos.append(info)
+            uniformElems = shader.getElementsByTagName("uniform")
+            if len(uniformElems) > 0:
+                uniforms = {}
+                info["uniforms"] = uniforms
+                for uniformElem in uniformElems:
+                    uniform = {"count": 1}
+                    for child in uniformElem.childNodes:
+                        if child.localName is None:
+                            pass
+                        elif child.localName == "name":
+                            uniforms[GetText(child.childNodes)] = uniform
+                        elif child.localName == "count":
+                            uniform["count"] = int(GetText(child.childNodes))
+                        elif child.localName == "transpose":
+                            uniform["transpose"] = (GetText(child.childNodes) == "true")
+                        else:
+                            if "type" in uniform:
+                                print "utype was:", uniform["type"], " found ", child.localName
+                                raise SyntaxError
+                            type_name = GetValidTypeName(child.localName)
+                            uniform["type"] = type_name
+                            valueText = GetText(child.childNodes).replace(",", " ")
+                            uniform["value"] = [float(t) for t in valueText.split()]
+                            m = MATRIX_RE.search(type_name)
+                            if m:
+                                # Why are these backward from the API?!?!?
+                                TransposeMatrix(uniform["value"], int(m.group(1)))
+        data = {
+          "name": os.path.basename(outname),
+          "model": GetModel(test),
+          "referenceProgram": shaderInfos[1],
+          "testProgram": shaderInfos[0],
+        }
+        gl_states = test.getElementsByTagName("glstate")
+        if len(gl_states) > 0:
+            state = {}
+            data["state"] = state
+            for gl_state in gl_states:
+                for state_name in gl_state.childNodes:
+                    if state_name.localName:
+                        values = {}
+                        for field in state_name.childNodes:
+                            if field.localName:
+                                values[field.localName] = GetText(field.childNodes)
+                        state[state_name.localName] = values
+        return data
 
-  def Process_shaderload(self, test, filename, outname):
-    """no need for shaderload tests"""
-    self.CopyShaders(test, filename, outname)
+    def Process_shaderload(self, test, filename, outname):
+        """no need for shaderload tests"""
+        self.CopyShaders(test, filename, outname)
 
-  def Process_extension(self, test, filename, outname):
-    """no need for extension tests"""
-    self.CopyShaders(test, filename, outname)
+    def Process_extension(self, test, filename, outname):
+        """no need for extension tests"""
+        self.CopyShaders(test, filename, outname)
 
-  def Process_createtests(self, test, filename, outname):
-    Log("createtests Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_createtests(self, test, filename, outname):
+        Log("createtests Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_GL2Test(self, test, filename, outname):
-    Log("GL2Test Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_GL2Test(self, test, filename, outname):
+        Log("GL2Test Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_uniformquery(self, test, filename, outname):
-    Log("uniformquery Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_uniformquery(self, test, filename, outname):
+        Log("uniformquery Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_egl_image_external(self, test, filename, outname):
-    """no need for egl_image_external tests"""
-    self.CopyShaders(test, filename, outname)
+    def Process_egl_image_external(self, test, filename, outname):
+        """no need for egl_image_external tests"""
+        self.CopyShaders(test, filename, outname)
 
-  def Process_dismount(self, test, filename, outname):
-    Log("dismount Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_dismount(self, test, filename, outname):
+        Log("dismount Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_build(self, test, filename, outname):
-    """don't need build tests"""
-    valid_tags = [
-      ["shader", "compstat", "linkstat"],
-      ["vertshader", "fragshader"],
-    ]
-    CheckForUnknownTags(valid_tags, test)
+    def Process_build(self, test, filename, outname):
+        """don't need build tests"""
+        valid_tags = [
+          ["shader", "compstat", "linkstat"],
+          ["vertshader", "fragshader"],
+        ]
+        CheckForUnknownTags(valid_tags, test)
 
-    shader = test.getElementsByTagName("shader")
-    if not shader:
-      return None
-    vs = GetElementText(shader[0], "vertshader")
-    fs = GetElementText(shader[0], "fragshader")
-    if vs and vs != "empty":
-      CopyShader(vs, filename, outname)
-    if fs and fs != "empty":
-      CopyShader(fs, filename, outname)
-    data = {
-      "name": os.path.basename(outname),
-      "compstat": bool(GetBoolElement(test, "compstat")),
-      "linkstat": bool(GetBoolElement(test, "linkstat")),
-      "testProgram": {
-        "vertexShader": vs,
-        "fragmentShader": fs,
-      },
-    }
-    attach = test.getElementsByTagName("attach")
-    if len(attach) > 0:
-      data["attachError"] = GetElementText(attach[0], "attacherror")
-    return data
+        shader = test.getElementsByTagName("shader")
+        if not shader:
+            return None
+        vs = GetElementText(shader[0], "vertshader")
+        fs = GetElementText(shader[0], "fragshader")
+        if vs and vs != "empty":
+            CopyShader(vs, filename, outname)
+        if fs and fs != "empty":
+            CopyShader(fs, filename, outname)
+        data = {
+          "name": os.path.basename(outname),
+          "compstat": bool(GetBoolElement(test, "compstat")),
+          "linkstat": bool(GetBoolElement(test, "linkstat")),
+          "testProgram": {
+            "vertexShader": vs,
+            "fragmentShader": fs,
+          },
+        }
+        attach = test.getElementsByTagName("attach")
+        if len(attach) > 0:
+            data["attachError"] = GetElementText(attach[0], "attacherror")
+        return data
 
-  def Process_coverage(self, test, filename, outname):
-    Log("coverage Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_coverage(self, test, filename, outname):
+        Log("coverage Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_attributes(self, test, filename, outname):
-    Log("attributes Not implemented:  %s" % filename)
-    self.CopyShaders(test, filename, outname)
+    def Process_attributes(self, test, filename, outname):
+        Log("attributes Not implemented:  %s" % filename)
+        self.CopyShaders(test, filename, outname)
 
-  def Process_fixed(self, test, filename, outname):
-    """no need for fixed function tests"""
-    self.CopyShaders(test, filename, outname)
+    def Process_fixed(self, test, filename, outname):
+        """no need for fixed function tests"""
+        self.CopyShaders(test, filename, outname)
 
 
 def main(argv):
-  """This is the main function."""
-  global VERBOSE
+    """This is the main function."""
+    global VERBOSE
 
-  parser = OptionParser()
-  parser.add_option(
-      "-v", "--verbose", action="store_true",
-      help="prints more output.")
+    parser = OptionParser()
+    parser.add_option(
+        "-v", "--verbose", action="store_true",
+        help="prints more output.")
 
-  (options, args) = parser.parse_args(args=argv)
+    (options, args) = parser.parse_args(args=argv)
 
-  if len(args) < 1:
-    pass # fix me
+    if len(args) < 1:
+        pass  # fix me
 
-  os.chdir(os.path.dirname(__file__) or '.')
+    os.chdir(os.path.dirname(__file__) or '.')
 
-  VERBOSE = options.verbose
+    VERBOSE = options.verbose
 
-  filename = args[0]
-  test_reader = TestReader(filename)
-  test_reader.ReadTests(filename)
+    filename = args[0]
+    test_reader = TestReader(filename)
+    test_reader.ReadTests(filename)
 
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/build.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/build.py
@@ -24,18 +24,16 @@
 #
 
 # Author: Mobica LTD
 
 import sys
 import re
 import os
 import subprocess
-import threading
-from sys import stdout, stderr, argv
 
 # Running this script
 # 1. To rebuild all dependencies:
 # $ build.py deps
 # 2. To build all targets without rebuilding dependencies
 # $ build.py build
 # 3. To build a single target without rebuilding dependencies
 # $ build.py build <target>
@@ -70,125 +68,134 @@ targets = {
     'draw': 'functional.gles3.es3fDrawTests',
     'attriblocation': 'functional.gles3.es3fAttribLocationTests',
     'textureShadowTests': 'functional.gles3.es3fTextureShadowTests',
     'texturewrap': 'functional.gles3.es3fTextureWrapTests',
     'negativetextureapi': 'functional.gles3.es3fNegativeTextureApiTests',
     'multisample': 'functional.gles3.es3fMultisampleTests',
     'negativefragmentapi': 'functional.gles3.es3fNegativeFragmentApiTests',
     'negativevertexarrayapi': 'functional.gles3.es3fNegativeVertexArrayApiTests',
-    'negativestateapi' : 'functional.gles3.es3fNegativeStateApiTests',
-    'negativeshaderapi' : 'functional.gles3.es3fNegativeShaderApiTests',
-    'rasterizerdiscard' : 'functional.gles3.es3fRasterizerDiscardTests',
-    'buffercopy' : 'functional.gles3.es3fBufferCopyTests',
-    'shaderindexing' : 'functional.gles3.es3fShaderIndexingTests',
-    'shaderloop' : 'functional.gles3.es3fShaderLoopTests',
-    'shaderstruct' : 'functional.gles3.es3fShaderStructTests',
-    'shaderswitch' : 'functional.gles3.es3fShaderSwitchTests',
-    'fborender' : 'functional.gles3.es3fFboRenderTest',
-    'shaderderivate' : 'functional.gles3.es3fShaderDerivateTests',
-    'builtinprecision' : 'functional.gles3.es3fBuiltinPrecisionTests',
-    'shaderbuiltinvar' : 'functional.gles3.es3fShaderBuiltinVarTests',
-    'texturefiltering' : 'functional.gles3.es3fTextureFilteringTests',
-    'fbocolor' : 'functional.gles3.es3fFboColorbufferTests',
-    'fragdepth' : 'functional.gles3.es3fFragDepthTests',
-    'shaderop' : 'functional.gles3.es3fShaderOperatorTests',
-    'vao' : 'functional.gles3.es3fVertexArrayObjectTests',
-    'clip' : 'functional.gles3.es3fClippingTests',
-    'inv' : 'functional.gles3.es3fFboInvalidateTests',
-    'defvertattr' : 'functional.gles3.es3fDefaultVertexAttributeTests',
-    'occlusion' : 'functional.gles3.es3fOcclusionQueryTests',
-    'shaderapi' : 'functional.gles3.es3fShaderApiTests',
-    'shaderpackingfunction' : 'functional.gles3.es3fShaderPackingFunctionTests',
-    'shadercommonfunction' : 'functional.gles3.es3fShaderCommonFunctionTests',
-    'shadermatrix' : 'functional.gles3.es3fShaderMatrixTest',
-    'shaderprecision' : 'functional.gles3.es3fShaderPrecisionTests',
+    'negativestateapi': 'functional.gles3.es3fNegativeStateApiTests',
+    'negativeshaderapi': 'functional.gles3.es3fNegativeShaderApiTests',
+    'rasterizerdiscard': 'functional.gles3.es3fRasterizerDiscardTests',
+    'buffercopy': 'functional.gles3.es3fBufferCopyTests',
+    'shaderindexing': 'functional.gles3.es3fShaderIndexingTests',
+    'shaderloop': 'functional.gles3.es3fShaderLoopTests',
+    'shaderstruct': 'functional.gles3.es3fShaderStructTests',
+    'shaderswitch': 'functional.gles3.es3fShaderSwitchTests',
+    'fborender': 'functional.gles3.es3fFboRenderTest',
+    'shaderderivate': 'functional.gles3.es3fShaderDerivateTests',
+    'builtinprecision': 'functional.gles3.es3fBuiltinPrecisionTests',
+    'shaderbuiltinvar': 'functional.gles3.es3fShaderBuiltinVarTests',
+    'texturefiltering': 'functional.gles3.es3fTextureFilteringTests',
+    'fbocolor': 'functional.gles3.es3fFboColorbufferTests',
+    'fragdepth': 'functional.gles3.es3fFragDepthTests',
+    'shaderop': 'functional.gles3.es3fShaderOperatorTests',
+    'vao': 'functional.gles3.es3fVertexArrayObjectTests',
+    'clip': 'functional.gles3.es3fClippingTests',
+    'inv': 'functional.gles3.es3fFboInvalidateTests',
+    'defvertattr': 'functional.gles3.es3fDefaultVertexAttributeTests',
+    'occlusion': 'functional.gles3.es3fOcclusionQueryTests',
+    'shaderapi': 'functional.gles3.es3fShaderApiTests',
+    'shaderpackingfunction': 'functional.gles3.es3fShaderPackingFunctionTests',
+    'shadercommonfunction': 'functional.gles3.es3fShaderCommonFunctionTests',
+    'shadermatrix': 'functional.gles3.es3fShaderMatrixTest',
+    'shaderprecision': 'functional.gles3.es3fShaderPrecisionTests',
     'bstate': 'functional.gles3.es3fBooleanStateQuery',
     'shaderstate': 'functional.gles3.es3fShaderStateQueryTests',
-    'fbostate' : 'functional.gles3.es3fFboStateQueryTests',
-    'rbostate' : 'functional.gles3.es3fRboStateQueryTests',
-    'bufferstate' : 'functional.gles3.es3fBufferObjectQueryTests',
-    'samplerstate' : 'functional.gles3.es3fSamplerStateQueryTests',
-    'texstate' : 'functional.gles3.es3fTextureStateQuery',
-    'internalformatstate' : 'functional.gles3.es3fInternalFormatQueryTests',
-    'texturespecification' : 'functional.gles3.es3fTextureSpecificationTests',
-    'shadertexturefunction' : 'functional.gles3.es3fShaderTextureFunctionTests',
-    'sync' : 'functional.gles3.es3fSyncTests',
-    'readpixel' : 'functional.gles3.es3fReadPixelTests',
-    'stringquery' : 'functional.gles3.es3fStringQueryTests',
-    'indexedstate' : 'functional.gles3.es3fIndexedStateQueryTests',
-    'integerstate' : 'functional.gles3.es3fIntegerStateQueryTests',
-    'floatstate' : 'functional.gles3.es3fFloatStateQueryTests'
+    'fbostate': 'functional.gles3.es3fFboStateQueryTests',
+    'rbostate': 'functional.gles3.es3fRboStateQueryTests',
+    'bufferstate': 'functional.gles3.es3fBufferObjectQueryTests',
+    'samplerstate': 'functional.gles3.es3fSamplerStateQueryTests',
+    'texstate': 'functional.gles3.es3fTextureStateQuery',
+    'internalformatstate': 'functional.gles3.es3fInternalFormatQueryTests',
+    'texturespecification': 'functional.gles3.es3fTextureSpecificationTests',
+    'shadertexturefunction': 'functional.gles3.es3fShaderTextureFunctionTests',
+    'sync': 'functional.gles3.es3fSyncTests',
+    'readpixel': 'functional.gles3.es3fReadPixelTests',
+    'stringquery': 'functional.gles3.es3fStringQueryTests',
+    'indexedstate': 'functional.gles3.es3fIndexedStateQueryTests',
+    'integerstate': 'functional.gles3.es3fIntegerStateQueryTests',
+    'floatstate': 'functional.gles3.es3fFloatStateQueryTests'
 }
 
 total_errors = 0
 total_warnings = 0
 
 results = dict()
 
+
 def dep_filename(target):
     return target + '.dep'
 
+
 def compiled_filename(target):
     return target + '.compiled'
 
+
 def write_to_file(outfile, cmdLine, redirect_stderr):
     stderr = None
     if redirect_stderr:
         stderr = subprocess.STDOUT
 
     with open(outfile, "w") as out_file:
-            proc = subprocess.Popen(cmdLine, shell=True, stdout=subprocess.PIPE, stderr=stderr)
-            while proc.poll() is None:
-                line = proc.stdout.readline()
-                out_file.write(line)
+        proc = subprocess.Popen(cmdLine, shell=True, stdout=subprocess.PIPE, stderr=stderr)
+        while proc.poll() is None:
+            line = proc.stdout.readline()
+            out_file.write(line)
 
-            out_file.flush()
-            proc.wait()
+        out_file.flush()
+        proc.wait()
+
 
 def read_file(file_path):
-    #File exist
+    # File exist
     if not file_exists(file_path):
         sys.exit(2)
 
     fo = open(file_path)
     lines = fo.read()
     fo.close()
     return lines
 
+
 def file_exists(file_path):
     if not os.path.exists:
-        print "The file " + file_name + " doesn't exists"
+        print("The file " + file_path + " doesn't exists")
         return False
     return True
 
+
 def build_deps(target, namespace):
-    cmdLine = 'python ../closure-library/closure/bin/build/closurebuilder.py --root=../closure-library --root=. --namespace=' + namespace
+    cmdLine = 'python ../closure-library/closure/bin/build/closurebuilder.py --root=../closure-library --root=. --namespace=' + namespace  # NOQA: E501
     print cmdLine
     write_to_file(dep_filename(target), cmdLine, False)
 
+
 def build_all_deps():
     for target in targets.keys():
         build_deps(target, targets[target])
 
+
 def buildDepsFile():
-    # the parameter "--root_with_prefix" is the relative path from the file goog/base.js to the root of the .js files we
-    # are working on.
-    cmdBuildDeps = 'python ../closure-library/closure/bin/build/depswriter.py --root_with_prefix=". ../../../deqp" > deqp-deps.js'
+    # the parameter "--root_with_prefix" is the relative path from the file goog/base.js to the
+    # root of the .js files we are working on.
+    cmdBuildDeps = 'python ../closure-library/closure/bin/build/depswriter.py --root_with_prefix=". ../../../deqp" > deqp-deps.js'  # NOQA: E501
 
     # Calls the python program that generates the google closure dependencies
     # write_to_file('deqp-deps.js', cmdBuildDeps, False)
     proc = subprocess.Popen(cmdBuildDeps, shell=True, stdout=subprocess.PIPE, stderr=None)
     proc.wait()
 
+
 def build_target(target, namespace):
     global total_errors
     global total_warnings
     deps = read_file(dep_filename(target))
-    cmdLine = 'java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --jscomp_warning undefinedVars --externs compiler_additional_extern.js'
+    cmdLine = 'java -jar compiler.jar --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --jscomp_warning undefinedVars --externs compiler_additional_extern.js'  # NOQA: E501
     for dep in deps.split('\n'):
         dep = dep.strip()
         if len(dep) > 0:
             cmdLine += ' --js ' + dep
     cmdLine += ' --closure_entry_point=' + namespace
     print cmdLine
     filename = compiled_filename(target)
     write_to_file(filename, cmdLine, True)
@@ -199,53 +206,59 @@ def build_target(target, namespace):
     if result:
         print target + ': ' + result.group(0)
         errors = int(result.group(1))
         warnings = int(result.group(2))
         total_errors += errors
         total_warnings += warnings
     results[target] = [errors, warnings]
 
+
 def build_all_targets():
     for target in targets.keys():
         build_target(target, targets[target])
 
+
 def format_target(target):
     deps = read_file(dep_filename(target))
     fixjsstyle = 'fixjsstyle.py'
     reformat = 'reformatting_tool.py'
     for dep in deps.split('\n'):
         dep = dep.strip()
         if len(dep) > 0 and not re.search('closure-library.*base\.js', dep):
             print fixjsstyle + ' ' + dep
             subprocess.call(['python', fixjsstyle, dep])
             print reformat + ' -f ' + dep
             subprocess.call(['python', reformat, '-f', dep])
 
+
 def format_all_targets():
     for target in targets.keys():
         format_target(target)
 
+
 def pass_or_fail():
     if total_errors + total_warnings == 0:
         print "Passed"
-    elif len(results) > 1: #display the summary only when building more than one target
+    elif len(results) > 1:  # display the summary only when building more than one target
         passed = [k for k, v in results.iteritems() if v[0] + v[1] == 0]
         failed = dict((k, v) for k, v in results.iteritems() if v[0] + v[1] != 0)
         print "\nBuild Summary:"
         # Print first the tests that passed
         for target in passed:
             print "{0:>30}\tPassed".format(target+":")
 
         # Print tests that failed. Fixed-width to improve readability
         for target in failed:
             errors = failed[target][0]
             warnings = failed[target][1]
             print "{0:>30}\tErrors: {1:4}\tWarnings: {2:4}".format(target+":", errors, warnings)
-        print "Compilation failed: {} error(s), {} warning(s).".format(total_errors, total_warnings)
+        print "Compilation failed: {} error(s), {} warning(s).".format(
+            total_errors, total_warnings)
+
 
 def main(argv):
     if len(argv) == 0:
         build_all_deps()
         build_all_targets()
         buildDepsFile()
         pass_or_fail()
     elif (argv[0] == 'deps'):
@@ -274,10 +287,11 @@ def main(argv):
         for target in targets.keys():
             print "\t{}".format(target)
     else:
         target = argv[0]
         build_deps(target, targets[target])
         build_target(target, targets[target])
         pass_or_fail()
 
+
 if __name__ == '__main__':
     main(sys.argv[1:])
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/builtinprecision/builtinprecision_test_generator.py
@@ -117,44 +117,50 @@ functional.gles3.es3fBuiltinPrecisionTes
     'refract',
     'matrixcompmult',
     'outerproduct',
     'transpose',
     'determinant',
     'inverse'
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, index):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'index': index
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'index': index
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/draw/draw_test_generator.py
@@ -68,39 +68,44 @@ functional.gles3.es3fDrawTests.run(gl, [
     'draw_elements',
     'draw_arrays_instanced',
     'draw_elements_instanced',
     'draw_range_elements',
     'instancing',
     'random',
 ]
 
+
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = _GROUPS[ii] + '.html'
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = _GROUPS[ii] + '.html'
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fbocolorbuffer/fbocolorbuffer_test_generator.py
@@ -77,57 +77,63 @@ functional.gles3.es3fFboColorbufferTests
     1,
     6,
     6,
     6,
     6,
     1
 ]
 
+
 def GenerateFilename(group, count, index):
-  """Generate test filename."""
-  filename = group
-  assert index >= 0 and index < count
-  if count > 1:
-    index_str = str(index)
-    if index < 10:
-      index_str = "0" + index_str
-    filename += "_" + index_str
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    assert index >= 0 and index < count
+    if count > 1:
+        index_str = str(index)
+        if index < 10:
+            index_str = "0" + index_str
+        filename += "_" + index_str
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
-  test_index = 0
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    group = _GROUPS[ii]
-    count = _GROUP_TEST_COUNTS[ii]
-    for index in range(count):
-      filename = GenerateFilename(group, count, index)
-      filelist.append(filename)
-      WriteTest(filename, test_index, test_index + 1)
-      test_index += 1
-  return filelist
+    """Generate all tests."""
+    assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+    test_index = 0
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        group = _GROUPS[ii]
+        count = _GROUP_TEST_COUNTS[ii]
+        for index in range(count):
+            filename = GenerateFilename(group, count, index)
+            filelist.append(filename)
+            WriteTest(filename, test_index, test_index + 1)
+            test_index += 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fboinvalidate/fboinvalidate_test_generator.py
@@ -75,57 +75,63 @@ functional.gles3.es3fFboInvalidateTests.
 _GROUP_TEST_COUNTS = [
     1,
     1,
     1,
     3,
     1
 ]
 
+
 def GenerateFilename(group, count, index):
-  """Generate test filename."""
-  filename = group
-  assert index >= 0 and index < count
-  if count > 1:
-    index_str = str(index)
-    if index < 10:
-      index_str = "0" + index_str
-    filename += "_" + index_str
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    assert index >= 0 and index < count
+    if count > 1:
+        index_str = str(index)
+        if index < 10:
+            index_str = "0" + index_str
+        filename += "_" + index_str
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
-  test_index = 0
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    group = _GROUPS[ii]
-    count = _GROUP_TEST_COUNTS[ii]
-    for index in range(count):
-      filename = GenerateFilename(group, count, index)
-      filelist.append(filename)
-      WriteTest(filename, test_index, test_index + 1)
-      test_index += 1
-  return filelist
+    """Generate all tests."""
+    assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+    test_index = 0
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        group = _GROUPS[ii]
+        count = _GROUP_TEST_COUNTS[ii]
+        for index in range(count):
+            filename = GenerateFilename(group, count, index)
+            filelist.append(filename)
+            WriteTest(filename, test_index, test_index + 1)
+            test_index += 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fborender/fborender_test_generator.py
@@ -78,57 +78,63 @@ functional.gles3.es3fFboRenderTest.run(g
     1,
     3,
     1,
     4,
     7,
     1
 ]
 
+
 def GenerateFilename(group, count, index):
-  """Generate test filename."""
-  filename = group
-  assert index >= 0 and index < count
-  if count > 1:
-    index_str = str(index)
-    if index < 10:
-      index_str = "0" + index_str
-    filename += "_" + index_str
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    assert index >= 0 and index < count
+    if count > 1:
+        index_str = str(index)
+        if index < 10:
+            index_str = "0" + index_str
+        filename += "_" + index_str
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
-  test_index = 0
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    group = _GROUPS[ii]
-    count = _GROUP_TEST_COUNTS[ii]
-    for index in range(count):
-      filename = GenerateFilename(group, count, index)
-      filelist.append(filename)
-      WriteTest(filename, test_index, test_index + 1)
-      test_index += 1
-  return filelist
+    """Generate all tests."""
+    assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+    test_index = 0
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        group = _GROUPS[ii]
+        count = _GROUP_TEST_COUNTS[ii]
+        for index in range(count):
+            filename = GenerateFilename(group, count, index)
+            filelist.append(filename)
+            WriteTest(filename, test_index, test_index + 1)
+            test_index += 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/fragmentoutput/fragmentoutput_test_generator.py
@@ -72,39 +72,44 @@ functional.gles3.es3fFragmentOutputTests
     'array.fixed',
     'array.int',
     'array.uint',
     'random_00',
     'random_01',
     'random_02'
 ]
 
+
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = _GROUPS[ii] + '.html'
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = _GROUPS[ii] + '.html'
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/framebufferblit/frambufferblit_test_generator.py
@@ -72,57 +72,63 @@ functional.gles3.es3fFramebufferBlitTest
 
 _GROUP_TEST_COUNTS = [
     7,
     35,
     1,
     7
 ]
 
+
 def GenerateFilename(group, count, index):
-  """Generate test filename."""
-  filename = group
-  assert index >= 0 and index < count
-  if count > 1:
-    index_str = str(index)
-    if index < 10:
-      index_str = "0" + index_str
-    filename += "_" + index_str
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    assert index >= 0 and index < count
+    if count > 1:
+        index_str = str(index)
+        if index < 10:
+            index_str = "0" + index_str
+        filename += "_" + index_str
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
-  test_index = 0
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    group = _GROUPS[ii]
-    count = _GROUP_TEST_COUNTS[ii]
-    for index in range(count):
-      filename = GenerateFilename(group, count, index)
-      filelist.append(filename)
-      WriteTest(filename, test_index, test_index + 1)
-      test_index += 1
-  return filelist
+    """Generate all tests."""
+    assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+    test_index = 0
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        group = _GROUPS[ii]
+        count = _GROUP_TEST_COUNTS[ii]
+        for index in range(count):
+            filename = GenerateFilename(group, count, index)
+            filelist.append(filename)
+            WriteTest(filename, test_index, test_index + 1)
+            test_index += 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/primitiverestart/primitiverestart_test_generator.py
@@ -60,42 +60,47 @@ var gl = wtu.create3DContext('canvas', n
 functional.gles3.es3fPrimitiveRestartTests.run(gl, [%(start)s, %(end)s]);
 </script>
 </body>
 </html>
 """
 
 _NUM_TESTS = 8
 
+
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(_NUM_TESTS):
-    index_str = str(ii)
-    if ii < 10:
-      index_str = "0" + index_str
-    filename = index_str + '.html'
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(_NUM_TESTS):
+        index_str = str(ii)
+        if ii < 10:
+            index_str = "0" + index_str
+        filename = index_str + '.html'
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderindexing/shaderindexing_test_generator.py
@@ -70,45 +70,51 @@ functional.gles3.es3fShaderIndexingTests
     'vec2',
     'vec3',
     'vec4',
     'mat_00',
     'mat_01',
     'mat_02',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadermatrix/shadermatrix_test_generator.py
@@ -94,45 +94,51 @@ functional.gles3.es3fShaderMatrixTest.ru
     'post_increment',
     'post_decrement',
     'add_assign',
     'sub_assign',
     'mul_assign',
     'div_assign',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shaderoperator/shaderoperator_test_generator.py
@@ -93,46 +93,52 @@ functional.gles3.es3fShaderOperatorTests
     'common_fucntions',
     'geometric',
     'float_compare',
     'int_compare',
     'bool_compare',
     'selection',
     'sequence',
 ]
-    
+
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/shadertexturefunction/shadertexturefunction_test_generator.py
@@ -75,46 +75,52 @@ functional.gles3.es3fShaderTextureFuncti
     'texturegrad',
     'texturegradoffset',
     'textureprojgrad',
     'textureprojgradoffset',
     'texelfetch',
     'texelfetchoffset',
     'texturesize'
 ]
-    
+
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturefiltering/texturefiltering_test_generator.py
@@ -84,72 +84,78 @@ functional.gles3.es3fTextureFilteringTes
     '2d_array_sizes',
     '2d_array_combinations',
     '3d_formats',
     '3d_sizes',
     '3d_combinations'
 ]
 
 _GROUP_TEST_COUNTS = [
-    _FILTERABLE_FORMAT_COUNT, # 2d_formats
-    _SIZE_2D_COUNT, # 2d_sizes
-    _MIN_FILTER_MODE_COUNT, # 2d_combinations
-    _FILTERABLE_FORMAT_COUNT, # cube_formats
-    _SIZE_CUBE_COUNT, # cube_sizes
-    _MIN_FILTER_MODE_COUNT, # cube_combinations
-    1, # cube_no_edges_visible
-    _FILTERABLE_FORMAT_COUNT, # 2d_array_formats
-    _SIZE_2D_ARRAY_COUNT, # 2d_array_sizes
-    _MIN_FILTER_MODE_COUNT, # 2d_array_combinations
-    _FILTERABLE_FORMAT_COUNT, # 3d_formats
-    _SIZE_3D_COUNT, # 3d_sizes,
-    _MIN_FILTER_MODE_COUNT * _MAG_FILTER_MODE_COUNT * _WRAP_MODE_COUNT, # 3d_combinations
+    _FILTERABLE_FORMAT_COUNT,  # 2d_formats
+    _SIZE_2D_COUNT,  # 2d_sizes
+    _MIN_FILTER_MODE_COUNT,  # 2d_combinations
+    _FILTERABLE_FORMAT_COUNT,  # cube_formats
+    _SIZE_CUBE_COUNT,  # cube_sizes
+    _MIN_FILTER_MODE_COUNT,  # cube_combinations
+    1,  # cube_no_edges_visible
+    _FILTERABLE_FORMAT_COUNT,  # 2d_array_formats
+    _SIZE_2D_ARRAY_COUNT,  # 2d_array_sizes
+    _MIN_FILTER_MODE_COUNT,  # 2d_array_combinations
+    _FILTERABLE_FORMAT_COUNT,  # 3d_formats
+    _SIZE_3D_COUNT,  # 3d_sizes,
+    _MIN_FILTER_MODE_COUNT * _MAG_FILTER_MODE_COUNT * _WRAP_MODE_COUNT,  # 3d_combinations
 ]
 
+
 def GenerateFilename(group, count, index):
-  """Generate test filename."""
-  assert index >= 0 and index < count
-  filename = group
-  if count > 1:
-    index_str = str(index)
-    if index < 10:
-      index_str = "0" + index_str
-    filename += "_" + index_str
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    assert index >= 0 and index < count
+    filename = group
+    if count > 1:
+        index_str = str(index)
+        if index < 10:
+            index_str = "0" + index_str
+        filename += "_" + index_str
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
-  test_index = 0
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    group = _GROUPS[ii]
-    count = _GROUP_TEST_COUNTS[ii]
-    for index in range(count):
-      filename = GenerateFilename(group, count, index)
-      filelist.append(filename)
-      WriteTest(filename, test_index, test_index + 1)
-      test_index += 1
-  return filelist
+    """Generate all tests."""
+    assert len(_GROUPS) == len(_GROUP_TEST_COUNTS)
+    test_index = 0
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        group = _GROUPS[ii]
+        count = _GROUP_TEST_COUNTS[ii]
+        for index in range(count):
+            filename = GenerateFilename(group, count, index)
+            filelist.append(filename)
+            WriteTest(filename, test_index, test_index + 1)
+            test_index += 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureformat/textureformat_test_generator.py
@@ -99,45 +99,51 @@ functional.gles3.es3fTextureFormatTests.
     'sized_color_3d_npot_01',
     'sized_color_3d_npot_02',
     'sized_color_3d_npot_03',
     'sized_depth_stencil',
     'compressed_2d',
     'compressed_cube',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/textureshadow/textureshadow_test_generator.py
@@ -84,50 +84,56 @@ functional.gles3.es3fTextureShadowTests.
     'less',
     'greater',
     'equal',
     'not_equal',
     'always',
     'never',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  ii = 0
-  for iTarget in range(len(_TARGETS)):
-    for iFilter in range(len(_FILTERS)):
-      for iFunc in range(len(_COMPARE_FUNCS)):
-        item = _TARGETS[iTarget] + '_' + _FILTERS[iFilter] + '_' + _COMPARE_FUNCS[iFunc]
-        filename = GenerateFilename(item)
-        filelist.append(filename)
-        WriteTest(filename, ii, ii + 1)
-        ii = ii + 1
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    ii = 0
+    for iTarget in range(len(_TARGETS)):
+        for iFilter in range(len(_FILTERS)):
+            for iFunc in range(len(_COMPARE_FUNCS)):
+                item = _TARGETS[iTarget] + '_' + _FILTERS[iFilter] + '_' + _COMPARE_FUNCS[iFunc]
+                filename = GenerateFilename(item)
+                filelist.append(filename)
+                WriteTest(filename, ii, ii + 1)
+                ii = ii + 1
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturespecification/texturespecification_test_generator.py
@@ -151,45 +151,51 @@ functional.gles3.es3fTextureSpecificatio
     'texstorage3d_format_3d_00',
     'texstorage3d_format_3d_01',
     'texstorage3d_format_3d_02',
     'texstorage3d_format_3d_03',
     'texstorage3d_format_depth_stencil',
     'texstorage3d_format_size',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/texturewrap/texturewrap_test_generator.py
@@ -83,45 +83,51 @@ functional.gles3.es3fTextureWrapTests.ru
     'etc2_srgb8_punchthrough_alpha1_pot',
     'etc2_srgb8_punchthrough_alpha1_npot',
     'etc2_eac_rgba8_pot',
     'etc2_eac_rgba8_npot',
     'etc2_eac_srgb8_alpha8_pot',
     'etc2_eac_srgb8_alpha8_npot',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/transformfeedback/transformfeedback_test_generator.py
@@ -90,46 +90,52 @@ functional.gles3.es3fTransformFeedbackTe
   'random_separate_points',
   'random_separate_lines',
   'random_separate_triangles',
   'random_interleaved_points',
   'random_interleaved_lines',
   'random_interleaved_triangles'
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for i in xrange(len(_GROUPS)):
-    groupname = _GROUPS[i]
-    filename = GenerateFilename(groupname)
-    filelist.append(filename)
-    WriteTest(filename, i, i+1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for i in xrange(len(_GROUPS)):
+        groupname = _GROUPS[i]
+        filename = GenerateFilename(groupname)
+        filelist.append(filename)
+        WriteTest(filename, i, i+1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformapi/uniformapi_test_generator.py
@@ -65,45 +65,51 @@ functional.gles3.es3fUniformApiTests.run
 
 _GROUPS = [
     'info_query',
     'value_initial',
     'value_assigned',
     'random',
 ]
 
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/uniformbuffers/uniformbuffers_test_generator.py
@@ -70,46 +70,52 @@ functional.gles3.es3fUniformBlockTests.r
     'single_struct_array',
     'single_nested_struct',
     'single_nested_struct_array',
     'instance_array_basic_type',
     'multi_basic_types',
     'multi_nested_struct',
     'random',
 ]
-    
+
+
 def GenerateFilename(group):
-  """Generate test filename."""
-  filename = group
-  filename += ".html"
-  return filename
+    """Generate test filename."""
+    filename = group
+    filename += ".html"
+    return filename
+
 
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  for ii in range(len(_GROUPS)):
-    filename = GenerateFilename(_GROUPS[ii])
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    for ii in range(len(_GROUPS)):
+        filename = GenerateFilename(_GROUPS[ii])
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/functional/gles3/vertexarrays/vertexarrays_test_generator.py
@@ -88,40 +88,45 @@ functional.gles3.es3fVertexArrayTests.ru
     'single_attribute.offset',
     'single_attribute.first',
     'multiple_attributes.count',
     'multiple_attributes.storage',
     'multiple_attributes.stride',
     'multiple_attributes.output',
 ]
 
+
 def WriteTest(filename, start, end):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_DO_NOT_EDIT_WARNING)
-  file.write(_HTML_TEMPLATE % {
-    'start': start,
-    'end': end
-  })
-  file.close
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_DO_NOT_EDIT_WARNING)
+    file.write(_HTML_TEMPLATE % {
+      'start': start,
+      'end': end
+    })
+    file.close
+
 
 def GenerateTests():
-  """Generate all tests."""
-  filelist = []
-  ii = 0
-  for ii in range(len(_GROUPS)):
-    filename = _GROUPS[ii] + ".html"
-    filelist.append(filename)
-    WriteTest(filename, ii, ii + 1)
-  return filelist
+    """Generate all tests."""
+    filelist = []
+    ii = 0
+    for ii in range(len(_GROUPS)):
+        filename = _GROUPS[ii] + ".html"
+        filelist.append(filename)
+        WriteTest(filename, ii, ii + 1)
+    return filelist
+
 
 def GenerateTestList(filelist):
-  file = open("00_test_list.txt", "wb")
-  file.write('\n'.join(filelist))
-  file.close
+    file = open("00_test_list.txt", "wb")
+    file.write('\n'.join(filelist))
+    file.close
+
 
 def main(argv):
-  """This is the main function."""
-  filelist = GenerateTests()
-  GenerateTestList(filelist)
+    """This is the main function."""
+    filelist = GenerateTests()
+    GenerateTestList(filelist)
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py
+++ b/dom/canvas/test/webgl-conf/checkout/deqp/genHTMLfromTest.py
@@ -1,43 +1,45 @@
 import os
 import re
 
 # Generate an HTML file for each .test file in the current directory
 #
 
-TEST_LIST_FILE = '00_test_list.txt';
-TEMPLATE = 'template.html';
+TEST_LIST_FILE = '00_test_list.txt'
+TEMPLATE = 'template.html'
+
 
 def genHTML(template, test):
-	contents = re.sub('___TEST_NAME___', "'" + test + "'", template);
-	filename = test + '.html';
-	print "Generating " + filename;
-	with open(test + '.html', 'w') as f:
-		f.write(contents);
-	return filename;
+    contents = re.sub('___TEST_NAME___', "'" + test + "'", template)
+    filename = test + '.html'
+    print "Generating " + filename
+    with open(test + '.html', 'w') as f:
+        f.write(contents)
+    return filename
 
 
 def process_test_files(template):
-	generated = [];
-	files = os.listdir(os.getcwd());
-	for file in files:
-		found = re.search('(^[^.].*)\.test$', file);
-		if found:
-			generated.append(genHTML(template,found.group(1)));
-	return generated;
+    generated = []
+    files = os.listdir(os.getcwd())
+    for file in files:
+        found = re.search('(^[^.].*)\.test$', file)
+        if found:
+            generated.append(genHTML(template, found.group(1)))
+    return generated
+
 
 def readTemplate():
-	contents = None;
-	with open(TEMPLATE, 'r') as f:
-		contents = f.read();
-	return contents;
+    contents = None
+    with open(TEMPLATE, 'r') as f:
+        contents = f.read()
+    return contents
 
 
-template = readTemplate();
+template = readTemplate()
 if (template):
-	test_list = process_test_files(template);
-	print "Generating " + TEST_LIST_FILE;
-	with open(TEST_LIST_FILE, 'w') as f:
-		for item in test_list:
-			f.write(item + '\n');
+    test_list = process_test_files(template)
+    print "Generating " + TEST_LIST_FILE
+    with open(TEST_LIST_FILE, 'w') as f:
+        for item in test_list:
+            f.write(item + '\n')
 else:
-	print "Couldn't find template file: " + TEMPLATE;
+    print "Couldn't find template file: " + TEMPLATE
--- a/dom/canvas/test/webgl-conf/checkout/py/lint/lint.py
+++ b/dom/canvas/test/webgl-conf/checkout/py/lint/lint.py
@@ -1,15 +1,14 @@
 #! /usr/bin/env python
 import os
 import subprocess
 import re
 import sys
 import fnmatch
-import commands
 
 from collections import defaultdict
 from optparse import OptionParser
 
 lint_root = os.path.dirname(os.path.abspath(__file__))
 repo_root = os.path.dirname(os.path.dirname(lint_root))
 
 
@@ -20,17 +19,17 @@ def git(command, *args):
 
     try:
         return subprocess.check_output(command_line, **proc_kwargs)
     except subprocess.CalledProcessError:
         raise
 
 
 def iter_files(flag=False, floder=""):
-    if floder != "" and floder != None:
+    if floder != "" and floder is not None:
         os.chdir(repo_root)
         for pardir, subdir, files in os.walk(floder):
             for item in subdir + files:
                 if not os.path.isdir(os.path.join(pardir, item)):
                     yield os.path.join(pardir, item)
         os.chdir(lint_root)
     else:
         if not flag:
@@ -53,22 +52,23 @@ def check_filename_space(path):
         return [("FILENAME WHITESPACE", "Filename of %s contains white space" % path, None)]
     return []
 
 
 def check_permission(path):
     bname = os.path.basename(path)
     if not re.compile('\.py$|\.sh$').search(bname):
         if os.access(os.path.join(repo_root, path), os.X_OK):
-            return [("UNNECESSARY EXECUTABLE PERMISSION", "%s contains unnecessary executable permission" % path, None)]
+            return [("UNNECESSARY EXECUTABLE PERMISSION", "%s contains unnecessary executable permission" %  # NOQA: E501
+                     path, None)]
     return []
 
 
 def parse_whitelist_file(filename):
-    data = defaultdict(lambda:defaultdict(set))
+    data = defaultdict(lambda: defaultdict(set))
 
     with open(filename) as f:
         for line in f:
             line = line.strip()
             if not line or line.startswith("#"):
                 continue
             parts = [item.strip() for item in line.split(":")]
             if len(parts) == 2:
@@ -92,16 +92,18 @@ def parse_whitelist_file(filename):
                         if None in allowed_lines or line in allowed_lines:
                             whitelisted[i] = True
 
         return [item for i, item in enumerate(errors) if not whitelisted[i]]
     return inner
 
 
 _whitelist_fn = None
+
+
 def whitelist_errors(path, errors):
     global _whitelist_fn
 
     if _whitelist_fn is None:
         _whitelist_fn = parse_whitelist_file(os.path.join(lint_root, "lint.whitelist"))
     return _whitelist_fn(path, errors)
 
 
@@ -131,16 +133,17 @@ class TabsRegexp(Regexp):
     pattern = "^\t"
     error = "INDENT TABS"
 
 
 class CRRegexp(Regexp):
     pattern = "\r$"
     error = "CR AT EOL"
 
+
 regexps = [item() for item in
            [TrailingWhitespaceRegexp,
             TabsRegexp,
             CRRegexp]]
 
 
 def check_regexp_line(path, f):
     errors = []
@@ -176,20 +179,20 @@ def main():
     global repo_root
     error_count = defaultdict(int)
 
     parser = OptionParser()
     parser.add_option('-p', '--pull', dest="pull_request", action='store_true', default=False)
     parser.add_option("-d", '--dir', dest="dir", help="specify the checking dir, e.g. tools")
     parser.add_option("-r", '--repo', dest="repo", help="specify the repo, e.g. WebGL")
     options, args = parser.parse_args()
-    if options.pull_request == True:
+    if options.pull_request:
         options.pull_request = "WebGL"
         repo_root = repo_root.replace("WebGL/sdk/tests", options.pull_request)
-    if options.repo == "" or options.repo == None:
+    if options.repo == "" or options.repo is None:
         options.repo = "WebGL/sdk/tests"
     repo_root = repo_root.replace("WebGL/sdk/tests", options.repo)
 
     def run_lint(path, fn, *args):
         errors = whitelist_errors(path, fn(path, *args))
         output_errors(errors)
         for error_type, error, line in errors:
             error_count[error_type] += 1
@@ -199,25 +202,27 @@ def main():
         if not os.path.exists(abs_path):
             continue
         for path_fn in file_path_lints:
             run_lint(path, path_fn)
         for state_fn in file_state_lints:
             run_lint(path, state_fn)
 
         if not os.path.isdir(abs_path):
-            if re.compile('\.html$|\.htm$|\.xhtml$|\.xhtm$|\.frag$|\.vert$|\.js$').search(abs_path):
+            if (re.compile('\.html$|\.htm$|\.xhtml$|\.xhtm$|\.frag$|\.vert$|\.js$').search(
+                    abs_path)):
                 with open(abs_path) as f:
                     for file_fn in file_content_lints:
                         run_lint(path, file_fn, f)
                         f.seek(0)
 
     output_error_count(error_count)
     return sum(error_count.itervalues())
 
+
 file_path_lints = [check_filename_space]
 file_content_lints = [check_regexp_line]
 file_state_lints = [check_permission]
 
 if __name__ == "__main__":
     error_count = main()
     if error_count > 0:
         sys.exit(1)
--- a/dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py
+++ b/dom/canvas/test/webgl-conf/checkout/py/tex_image_test_generator.py
@@ -78,141 +78,154 @@ DO NOT EDIT!
   'image-bitmap-from-image',
   'image-bitmap-from-video',
   'image-bitmap-from-canvas',
   'image-bitmap-from-blob',
   'image-bitmap-from-image-bitmap'
 ]
 
 _FORMATS_TYPES_WEBGL1 = [
-  {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5' },
-  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4' },
-  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1' },
-  {'internal_format': 'LUMINANCE',       'format': 'LUMINANCE',       'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'ALPHA',           'format': 'ALPHA',           'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'LUMINANCE_ALPHA', 'format': 'LUMINANCE_ALPHA', 'type': 'UNSIGNED_BYTE' },
+  {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5'},
+  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4'},
+  {'internal_format': 'RGBA', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1'},
+  {'internal_format': 'LUMINANCE',       'format': 'LUMINANCE',       'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'ALPHA',           'format': 'ALPHA',           'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'LUMINANCE_ALPHA', 'format': 'LUMINANCE_ALPHA', 'type': 'UNSIGNED_BYTE'},
 ]
 
 _FORMATS_TYPES_WEBGL2 = [
-  {'internal_format': 'R8', 'format': 'RED', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'R16F', 'format': 'RED', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'R16F', 'format': 'RED', 'type': 'FLOAT' },
-  {'internal_format': 'R32F', 'format': 'RED', 'type': 'FLOAT' },
-  {'internal_format': 'R8UI', 'format': 'RED_INTEGER', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RG8', 'format': 'RG', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RG16F', 'format': 'RG', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'RG16F', 'format': 'RG', 'type': 'FLOAT' },
-  {'internal_format': 'RG32F', 'format': 'RG', 'type': 'FLOAT' },
-  {'internal_format': 'RG8UI', 'format': 'RG_INTEGER', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'SRGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5' },
-  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'UNSIGNED_INT_10F_11F_11F_REV' },
-  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'FLOAT' },
-  {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'FLOAT' },
-  {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'FLOAT' },
-  {'internal_format': 'RGB32F', 'format': 'RGB', 'type': 'FLOAT' },
-  {'internal_format': 'RGB8UI', 'format': 'RGB_INTEGER', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGBA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'SRGB8_ALPHA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1' },
-  {'internal_format': 'RGB10_A2', 'format': 'RGBA', 'type': 'UNSIGNED_INT_2_10_10_10_REV' },
-  {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE' },
-  {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4' },
-  {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'HALF_FLOAT' },
-  {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'FLOAT' },
-  {'internal_format': 'RGBA32F', 'format': 'RGBA', 'type': 'FLOAT' },
-  {'internal_format': 'RGBA8UI', 'format': 'RGBA_INTEGER', 'type': 'UNSIGNED_BYTE' },
+  {'internal_format': 'R8', 'format': 'RED', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'R16F', 'format': 'RED', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'R16F', 'format': 'RED', 'type': 'FLOAT'},
+  {'internal_format': 'R32F', 'format': 'RED', 'type': 'FLOAT'},
+  {'internal_format': 'R8UI', 'format': 'RED_INTEGER', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RG8', 'format': 'RG', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RG16F', 'format': 'RG', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'RG16F', 'format': 'RG', 'type': 'FLOAT'},
+  {'internal_format': 'RG32F', 'format': 'RG', 'type': 'FLOAT'},
+  {'internal_format': 'RG8UI', 'format': 'RG_INTEGER', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'SRGB8', 'format': 'RGB', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB565', 'format': 'RGB', 'type': 'UNSIGNED_SHORT_5_6_5'},
+  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'UNSIGNED_INT_10F_11F_11F_REV'},
+  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'R11F_G11F_B10F', 'format': 'RGB', 'type': 'FLOAT'},
+  {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'RGB9_E5', 'format': 'RGB', 'type': 'FLOAT'},
+  {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'RGB16F', 'format': 'RGB', 'type': 'FLOAT'},
+  {'internal_format': 'RGB32F', 'format': 'RGB', 'type': 'FLOAT'},
+  {'internal_format': 'RGB8UI', 'format': 'RGB_INTEGER', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGBA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'SRGB8_ALPHA8', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGB5_A1', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_5_5_5_1'},
+  {'internal_format': 'RGB10_A2', 'format': 'RGBA', 'type': 'UNSIGNED_INT_2_10_10_10_REV'},
+  {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_BYTE'},
+  {'internal_format': 'RGBA4', 'format': 'RGBA', 'type': 'UNSIGNED_SHORT_4_4_4_4'},
+  {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'HALF_FLOAT'},
+  {'internal_format': 'RGBA16F', 'format': 'RGBA', 'type': 'FLOAT'},
+  {'internal_format': 'RGBA32F', 'format': 'RGBA', 'type': 'FLOAT'},
+  {'internal_format': 'RGBA8UI', 'format': 'RGBA_INTEGER', 'type': 'UNSIGNED_BYTE'},
 ]
 
+
 def GenerateFilename(dimension, element_type, internal_format, format, type):
-  """Generate test filename."""
-  filename = ("tex-" + dimension + "d-" +
-              internal_format + "-" + format + "-" + type + ".html")
-  return filename.lower()
+    """Generate test filename."""
+    filename = ("tex-" + dimension + "d-" +
+                internal_format + "-" + format + "-" + type + ".html")
+    return filename.lower()
+
 
-def WriteTest(filename, dimension, element_type, internal_format, format, type, default_context_version):
-  """Write one test."""
-  file = open(filename, "wb")
-  file.write(_LICENSE)
-  file.write(_DO_NOT_EDIT_WARNING)
-  code = """
+def WriteTest(filename, dimension, element_type, internal_format, format, type,
+              default_context_version):
+    """Write one test."""
+    file = open(filename, "wb")
+    file.write(_LICENSE)
+    file.write(_DO_NOT_EDIT_WARNING)
+    code = """
 <!DOCTYPE html>
 <html>
 <head>
 <meta charset="utf-8">
 <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
 <script src="../../../js/js-test-pre.js"></script>
 <script src="../../../js/webgl-test-utils.js"></script>
 <script src="../../../js/tests/tex-image-and-sub-image-utils.js"></script>"""
-  if element_type == 'image-bitmap-from-image-data' or element_type == 'image-bitmap-from-image' or \
-     element_type == 'image-bitmap-from-video' or element_type == 'image-bitmap-from-canvas' or \
-     element_type == 'image-bitmap-from-blob' or element_type == 'image-bitmap-from-image-bitmap':
+    if (element_type == 'image-bitmap-from-image-data' or
+        element_type == 'image-bitmap-from-image' or
+        element_type == 'image-bitmap-from-video' or
+        element_type == 'image-bitmap-from-canvas' or
+        element_type == 'image-bitmap-from-blob' or
+        element_type == 'image-bitmap-from-image-bitmap'):
+        code += """
+<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>"""
     code += """
-<script src="../../../js/tests/tex-image-and-sub-image-with-image-bitmap-utils.js"></script>"""
-  code += """
 <script src="../../../js/tests/tex-image-and-sub-image-%(dimension)sd-with-%(element_type)s.js"></script>
 </head>
-<body>"""
-  if element_type == 'image-data':
-    code += """
+<body>"""  # NOQA: E501
+    if element_type == 'image-data':
+        code += """
 <canvas id="texcanvas" width="2" height="2"></canvas>"""
-  code += """
+    code += """
 <canvas id="example" width="32" height="32"></canvas>"""
-  code += """
+    code += """
 <div id="description"></div>
 <div id="console"></div>
 <script>
 "use strict";
 function testPrologue(gl) {
     return true;
 }
 
 generateTest("%(internal_format)s", "%(format)s", "%(type)s", testPrologue, "../../../resources/", %(default_context_version)s)();
 </script>
 </body>
 </html>
-"""
-  file.write(code % {
-    'dimension': dimension,
-    'element_type': element_type,
-    'internal_format': internal_format,
-    'format': format,
-    'type': type,
-    'default_context_version': default_context_version,
-  })
-  file.close()
+"""  # NOQA: E501
+    file.write(code % {
+      'dimension': dimension,
+      'element_type': element_type,
+      'internal_format': internal_format,
+      'format': format,
+      'type': type,
+      'default_context_version': default_context_version,
+    })
+    file.close()
+
 
 def GenerateTests(test_dir, test_cases, dimension, default_context_version):
-  test_dir_template = test_dir + '/%s'
-  for element_type in _ELEMENT_TYPES:
-    os.chdir(test_dir_template % element_type.replace('-', '_'))
-    if dimension == '3':
-      # Assume we write 2D tests first.
-      index_file = open("00_test_list.txt", "ab")
-    else:
-      index_file = open("00_test_list.txt", "wb")
-    for tex_info in test_cases:
-      internal_format = tex_info['internal_format']
-      format = tex_info['format']
-      type = tex_info['type']
-      filename = GenerateFilename(dimension, element_type, internal_format, format, type)
-      index_file.write(filename)
-      index_file.write('\n')
-      WriteTest(filename, dimension, element_type, internal_format, format, type, default_context_version)
-    index_file.close();
+    test_dir_template = test_dir + '/%s'
+    for element_type in _ELEMENT_TYPES:
+        os.chdir(test_dir_template % element_type.replace('-', '_'))
+        if dimension == '3':
+            # Assume we write 2D tests first.
+            index_file = open("00_test_list.txt", "ab")
+        else:
+            index_file = open("00_test_list.txt", "wb")
+        for tex_info in test_cases:
+            internal_format = tex_info['internal_format']
+            format = tex_info['format']
+            type = tex_info['type']
+            filename = GenerateFilename(dimension, element_type, internal_format, format, type)
+            index_file.write(filename)
+            index_file.write('\n')
+            WriteTest(filename, dimension, element_type, internal_format,
+                      format, type, default_context_version)
+        index_file.close()
+
 
 def main(argv):
-  """This is the main function."""
-  py_dir = os.path.dirname(os.path.realpath(__file__))
-  GenerateTests(os.path.realpath(py_dir + '/../conformance/textures'), _FORMATS_TYPES_WEBGL1, '2', '1')
-  GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'), _FORMATS_TYPES_WEBGL2, '2', '2')
-  GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'), _FORMATS_TYPES_WEBGL2, '3', '2')
+    """This is the main function."""
+    py_dir = os.path.dirname(os.path.realpath(__file__))
+    GenerateTests(os.path.realpath(py_dir + '/../conformance/textures'),
+                  _FORMATS_TYPES_WEBGL1, '2', '1')
+    GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'),
+                  _FORMATS_TYPES_WEBGL2, '2', '2')
+    GenerateTests(os.path.realpath(py_dir + '/../conformance2/textures'),
+                  _FORMATS_TYPES_WEBGL2, '3', '2')
+
 
 if __name__ == '__main__':
-  sys.exit(main(sys.argv[1:]))
+    sys.exit(main(sys.argv[1:]))
--- a/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
+++ b/dom/canvas/test/webgl-conf/generate-wrappers-and-manifest.py
@@ -3,17 +3,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 # Write a Mochitest manifest for WebGL conformance test files.
 
 import os
 import re
-from pathlib import *
+from pathlib import Path
 
 # All paths in this file are based where this file is run.
 WRAPPER_TEMPLATE_FILE = 'mochi-wrapper.html.template'
 MANIFEST_TEMPLATE_FILE = 'mochitest.ini.template'
 ERRATA_FILE = 'mochitest-errata.ini'
 DEST_MANIFEST_PATHSTR = 'generated-mochitest.ini'
 
 BASE_TEST_LIST_PATHSTR = 'checkout/00_test_list.txt'
@@ -36,16 +36,17 @@ ACCEPTABLE_ERRATA_KEYS = set([
   'fail-if',
   'skip-if',
   'subsuite',
 ])
 
 ########################################################################
 # GetTestList
 
+
 def GetTestList():
     split = BASE_TEST_LIST_PATHSTR.rsplit('/', 1)
     basePath = '.'
     testListFile = split[-1]
     if len(split) == 2:
         basePath = split[0]
 
     allowWebGL1 = True
@@ -58,16 +59,17 @@ def GetTestList():
         x.path = os.path.relpath(x.path, basePath).replace(os.sep, '/')
         continue
 
     return testList
 
 ##############################
 # Internals
 
+
 def IsVersionLess(a, b):
     aSplit = [int(x) for x in a.split('.')]
     bSplit = [int(x) for x in b.split('.')]
 
     while len(aSplit) < len(bSplit):
         aSplit.append(0)
 
     while len(aSplit) > len(bSplit):
@@ -79,16 +81,17 @@ def IsVersionLess(a, b):
 
         if aVal == bVal:
             continue
 
         return aVal < bVal
 
     return False
 
+
 class TestEntry:
     def __init__(self, path, webgl1, webgl2):
         self.path = path
         self.webgl1 = webgl1
         self.webgl2 = webgl2
         return
 
 
@@ -110,30 +113,30 @@ def AccumTests(pathStr, listFile, allowW
             curLine = line.lstrip()
             if curLine.startswith('//'):
                 continue
             if curLine.startswith('#'):
                 continue
 
             webgl1 = allowWebGL1
             webgl2 = allowWebGL2
-            while curLine.startswith('--'): # '--min-version 1.0.2 foo.html'
+            while curLine.startswith('--'):  # '--min-version 1.0.2 foo.html'
                 (flag, curLine) = curLine.split(' ', 1)
                 if flag == '--min-version':
                     (minVersion, curLine) = curLine.split(' ', 1)
-                    if not IsVersionLess(minVersion, "2.0.0"): # >= 2.0.0
+                    if not IsVersionLess(minVersion, "2.0.0"):  # >= 2.0.0
                         webgl1 = False
                         break
                 elif flag == '--max-version':
                     (maxVersion, curLine) = curLine.split(' ', 1)
                     if IsVersionLess(maxVersion, "2.0.0"):
                         webgl2 = False
                         break
                 elif flag == '--slow':
-                    continue # TODO
+                    continue  # TODO
                 else:
                     text = 'Unknown flag \'{}\': {}:{}: {}'.format(flag, listPath,
                                                                    lineNum, line)
                     assert False, text
                 continue
 
             assert(webgl1 or webgl2)
 
@@ -159,16 +162,17 @@ def AccumTests(pathStr, listFile, allowW
             AccumTests(nextPathStr, nextListFile, webgl1, webgl2, out_testList)
             continue
 
     return
 
 ########################################################################
 # Templates
 
+
 def FillTemplate(inFilePath, templateDict, outFilePath):
     templateShell = ImportTemplate(inFilePath)
     OutputFilledTemplate(templateShell, templateDict, outFilePath)
     return
 
 
 def ImportTemplate(inFilePath):
     with open(inFilePath, 'r') as f:
@@ -180,27 +184,28 @@ def OutputFilledTemplate(templateShell, 
 
     with open(outFilePath, 'w', newline='\n') as f: