summaryrefslogtreecommitdiff
path: root/utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py')
-rwxr-xr-xutils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py b/utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py
index be8985ce..7d56c9f9 100755
--- a/utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py
+++ b/utils/ipc/mojo/public/tools/bindings/concatenate_and_replace_closure_exports.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright 2018 The Chromium Authors. All rights reserved.
+# Copyright 2018 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -20,6 +20,7 @@ from __future__ import print_function
import optparse
import re
+import sys
_MOJO_INTERNAL_MODULE_NAME = "mojo.internal"
@@ -31,10 +32,10 @@ def FilterLine(filename, line, output):
return
if line.startswith("goog.provide"):
- match = re.match("goog.provide\('([^']+)'\);", line)
+ match = re.match(r"goog.provide\('([^']+)'\);", line)
if not match:
print("Invalid goog.provide line in %s:\n%s" % (filename, line))
- exit(1)
+ sys.exit(1)
module_name = match.group(1)
if module_name == _MOJO_INTERNAL_MODULE_NAME:
@@ -67,7 +68,8 @@ def main():
Concatenate several files into one, stripping Closure provide and
require directives along the way.""")
(_, args) = parser.parse_args()
- exit(0 if ConcatenateAndReplaceExports(args) else 1)
+ sys.exit(0 if ConcatenateAndReplaceExports(args) else 1)
+
if __name__ == "__main__":
main()