Bug 1468328 - Make other codecoverage import statements Python3 compatible. r=marco draft
authorassiya <akhuzyakhmetova@mozilla.com>
Sat, 16 Jun 2018 00:06:25 -0700
changeset 807922 e3886d147ee0b31ae8540d0a8003fedbd84281a4
parent 807614 77d195514c5bee921a7086037d3738e01096c631
push id113246
push userbmo:assiya.khuzyakhmetova@nu.edu.kz
push dateSat, 16 Jun 2018 07:18:49 +0000
reviewersmarco
bugs1468328
milestone62.0a1
Bug 1468328 - Make other codecoverage import statements Python3 compatible. r=marco MozReview-Commit-ID: J3uaRsbE1sf
python/mozbuild/mozbuild/codecoverage/manifest_handler.py
python/mozbuild/mozpack/chrome/manifest.py
--- a/python/mozbuild/mozbuild/codecoverage/manifest_handler.py
+++ b/python/mozbuild/mozbuild/codecoverage/manifest_handler.py
@@ -1,14 +1,18 @@
 # 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 collections import defaultdict
-import urlparse
+
+try:
+    import urlparse
+except ImportError:
+    import urllib.parse as urlparse
 
 from mozpack.chrome.manifest import (
     Manifest,
     ManifestChrome,
     ManifestOverride,
     ManifestResource,
     parse_manifest,
 )
--- a/python/mozbuild/mozpack/chrome/manifest.py
+++ b/python/mozbuild/mozpack/chrome/manifest.py
@@ -1,17 +1,22 @@
 # 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 __future__ import absolute_import
 
 import re
 import os
-from urlparse import urlparse
+
+try:
+    from urlparse import urlparse
+except ImportError:
+    from urllib.parse import urlparse
+
 import mozpack.path as mozpath
 from mozpack.chrome.flags import Flags
 from mozpack.errors import errors
 
 
 class ManifestEntry(object):
     '''
     Base class for all manifest entry types.