Bug 1622972 - Fix python-compatibility test errors. r=darktrojan
authorRob Lemley <rob@thunderbird.net>
Sun, 22 Mar 2020 12:37:52 +0200
changeset 38547 c8aea2febde1ce9fb9ddf30a5fc2fd540d9fa02e
parent 38546 cbfbee1f42949588291780fc55f8f2ba36c74a2e
child 38548 ca55126db32af5036a9242ce93b6e2082bfa9db6
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersdarktrojan
bugs1622972
Bug 1622972 - Fix python-compatibility test errors. r=darktrojan Fixes for mozlint Python-compatibility test. These files all needed some future imports.
build/source_repos.py
calendar/lightning/repack/modify-manifest.py
calendar/lightning/repack/webextify.py
calendar/locales/filter.py
mail/locales/filter.py
mail/test/marionette/test_addressbook.py
mail/test/marionette/test_empty.py
mozharness/repackage/base.py
--- a/build/source_repos.py
+++ b/build/source_repos.py
@@ -1,13 +1,13 @@
 #  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 print_function, unicode_literals
+from __future__ import print_function, unicode_literals, absolute_import
 
 import sys
 import os
 
 import buildconfig
 
 sourcestamp_tmpl = """{buildid}
 {comm_repo}/rev/{comm_rev}
--- a/calendar/lightning/repack/modify-manifest.py
+++ b/calendar/lightning/repack/modify-manifest.py
@@ -1,13 +1,15 @@
 #!/usr/bin/python3
 # 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 print_function, unicode_literals, absolute_import
+
 import json
 
 with open("manifest.json", encoding="utf-8") as fp:
     data = json.load(fp)
 
 data["name"] = "__MSG_extensionName__"
 data["description"] = "__MSG_extensionDescription__"
 data["author"] = "__MSG_extensionAuthor__"
--- a/calendar/lightning/repack/webextify.py
+++ b/calendar/lightning/repack/webextify.py
@@ -1,13 +1,15 @@
 #!/usr/bin/python3
 # 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 print_function, unicode_literals, absolute_import
+
 import json
 import sys
 
 keys = {
     "extensions.{e2fda1a4-762b-4020-b5ad-a41df1933103}.name": "extensionName",
     "extensions.{e2fda1a4-762b-4020-b5ad-a41df1933103}.description": "extensionDescription",
     "extensions.{e2fda1a4-762b-4020-b5ad-a41df1933103}.creator": "extensionAuthor",
 }
--- a/calendar/locales/filter.py
+++ b/calendar/locales/filter.py
@@ -1,8 +1,9 @@
+from __future__ import absolute_import
 
 def test(mod, path, entity = None):
   import re
 
   # ignore anything but calendar stuff
   if mod not in ("netwerk", "dom", "toolkit", "security/manager",
                  "calendar"):
     return False
--- a/mail/locales/filter.py
+++ b/mail/locales/filter.py
@@ -1,8 +1,10 @@
+from __future__ import absolute_import
+
 def test(mod, path, entity=None):
   import re
   # ignore anything but Thunderbird
   if mod not in ("netwerk", "dom", "toolkit", "security/manager",
                  "devtools/shared", "devtools/client",
                  "mail", "chat", "extensions/spellcheck",
                  "other-licenses/branding/thunderbird",
                  "mail/branding/thunderbird"):
--- a/mail/test/marionette/test_addressbook.py
+++ b/mail/test/marionette/test_addressbook.py
@@ -1,15 +1,15 @@
 # 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/.
 
 """Test the behavior of the address book UI"""
 
-from __future__ import print_function
+from __future__ import print_function, unicode_literals, absolute_import
 
 from marionette_driver import By, Wait
 from marionette_driver.keys import Keys
 from marionette_harness import MarionetteTestCase
 from marionette_harness.runner.mixins.window_manager import WindowManagerMixin
 
 
 class TestAddressBook(WindowManagerMixin, MarionetteTestCase):
--- a/mail/test/marionette/test_empty.py
+++ b/mail/test/marionette/test_empty.py
@@ -1,12 +1,12 @@
 # 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 print_function
+from __future__ import print_function, unicode_literals, absolute_import
 
 from marionette_harness import MarionetteTestCase
 
 class TestMain(MarionetteTestCase):
 
     def test_empty(self):
         return
--- a/mozharness/repackage/base.py
+++ b/mozharness/repackage/base.py
@@ -1,8 +1,9 @@
+from __future__ import absolute_import
 import os
 
 # Paths are relative to mozilla-central
 config = {
     "package-name": "thunderbird",
     "installer-tag": "comm/mail/installer/windows/app.tag",
     "sfx-stub": "comm/other-licenses/7zstub/thunderbird/7zSD.sfx",
     "stub-installer-tag": "",