Bug 1176642 - Use absolute_import in mach_commands.py files; r=glandium

This removes ambiguity as to which modules are being imported, making
import slightly faster as Python doesn't need to test so many
directories for file presence.

All files should already be using absolute imports because mach command
modules aren't imported to the package they belong to: they instead
belong to the "mach" package. So relative imports shouldn't have been
used.
This commit is contained in:
Gregory Szorc 2015-06-21 17:39:09 -07:00
parent 567f5c19ea
commit 0d16ec0cfa
24 changed files with 28 additions and 20 deletions

View File

@ -4,6 +4,8 @@
# Integrates the xpcshell test runner with mach. # Integrates the xpcshell test runner with mach.
from __future__ import absolute_import
import os import os
import mozpack.path as mozpath import mozpack.path as mozpath

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import os import os
import subprocess import subprocess

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import os import os
import sys import sys

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import mozpack.path as mozpath import mozpack.path as mozpath
import os import os

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import argparse import argparse
import logging import logging

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this, # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
from mach.decorators import ( from mach.decorators import (
CommandArgument, CommandArgument,

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import argparse import argparse
import glob import glob

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this, # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
from mach.decorators import ( from mach.decorators import (
CommandProvider, CommandProvider,

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import argparse import argparse
import os import os

View File

@ -4,6 +4,8 @@
# This modules provides functionality for dealing with code completion. # This modules provides functionality for dealing with code completion.
from __future__ import absolute_import
import os import os
from mach.decorators import ( from mach.decorators import (

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
from collections import defaultdict from collections import defaultdict
import os import os

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import argparse import argparse
import json import json

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import mozpack.path as mozpath import mozpack.path as mozpath

View File

@ -4,6 +4,8 @@
# Integrates luciddream test runner with mach. # Integrates luciddream test runner with mach.
from __future__ import absolute_import
import os import os
from mozbuild.base import ( from mozbuild.base import (

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import os import os
import pprint import pprint

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import os import os
import sys import sys

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
from argparse import Namespace from argparse import Namespace
from collections import defaultdict from collections import defaultdict

View File

@ -4,7 +4,7 @@
# Integrates Talos mozharness with mach # Integrates Talos mozharness with mach
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import os import os
import sys import sys

View File

@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import os import os
import json import json
import copy import copy

View File

@ -4,7 +4,7 @@
# Integrates the web-platform-tests test runner with mach. # Integrates the web-platform-tests test runner with mach.
from __future__ import unicode_literals, print_function from __future__ import absolute_import, unicode_literals, print_function
import os import os
import sys import sys

View File

@ -4,7 +4,7 @@
# Integrates the xpcshell test runner with mach. # Integrates the xpcshell test runner with mach.
from __future__ import unicode_literals, print_function from __future__ import absolute_import, unicode_literals, print_function
import argparse import argparse
import os import os

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import os import os

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals from __future__ import absolute_import, unicode_literals
import sys import sys
import os import os

View File

@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this, # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function, unicode_literals from __future__ import absolute_import, print_function, unicode_literals
import os import os
import sys import sys