Bug 1468328 - Make import statement Python3 compatible. r=marco
authorassiya <akhuzyakhmetova@mozilla.com>
Thu, 14 Jun 2018 07:32:58 -0700
changeset 422629 dc997a4e045ec9c83288466a013a029cc475603c
parent 422628 0f848f76f6e75bd99e3d56f5fff046efb516d2a0
child 422657 0b5495dc100dd3bfda0886a4ad563a3c729c9b72
child 422658 30a61cd82d54877d8850154914594fa10e1844c2
push id34139
push useraciure@mozilla.com
push dateFri, 15 Jun 2018 09:48:05 +0000
treeherdermozilla-central@dc997a4e045e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarco
bugs1468328
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1468328 - Make import statement Python3 compatible. r=marco MozReview-Commit-ID: 6NPlMjT6K8J
python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
--- a/python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
+++ b/python/mozbuild/mozbuild/codecoverage/lcov_rewriter.py
@@ -1,16 +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/.
 
 from argparse import ArgumentParser
 import json
 import os
-import urlparse
+
+try:
+    import urlparse
+except ImportError:
+    import urllib.parse as urlparse
 
 from mozpack.chrome.manifest import parse_manifest
 import mozpack.path as mozpath
 from manifest_handler import ChromeManifestHandler
 
 class LcovRecord(object):
     __slots__ = ("test_name",
                  "source_file",