Bug 1468328 - Make other codecoverage import statements Python3 compatible. r=marco
MozReview-Commit-ID: 9UmVk6onIQw
--- 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:
+ import urlparse
+except ImportError:
+ import urllib.parse as 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.