Skip to content

Commit

Permalink
Bug 1176642 - Use absolute_import in mach_commands.py files; r=glandium
Browse files Browse the repository at this point in the history
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.

--HG--
extra : commitid : 6tFME1KKfTD
extra : rebase_source : 78728f82f5487281620e00c2a8004cd5e1968087
  • Loading branch information
indygreg committed Jun 22, 2015
1 parent 70e857c commit 3e949ee
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 20 deletions.
2 changes: 2 additions & 0 deletions addon-sdk/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Integrates the xpcshell test runner with mach.

from __future__ import absolute_import

import os

import mozpack.path as mozpath
Expand Down
2 changes: 1 addition & 1 deletion build/valgrind/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import os
import subprocess
Expand Down
2 changes: 1 addition & 1 deletion dom/bindings/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion layout/tools/reftest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import mozpack.path as mozpath
import os
Expand Down
2 changes: 1 addition & 1 deletion mobile/android/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import argparse
import logging
Expand Down
2 changes: 1 addition & 1 deletion python/compare-locales/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

from mach.decorators import (
CommandArgument,
Expand Down
2 changes: 1 addition & 1 deletion python/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import argparse
import glob
Expand Down
2 changes: 1 addition & 1 deletion python/mozboot/mozboot/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

from mach.decorators import (
CommandProvider,
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/backend/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import argparse
import os
Expand Down
2 changes: 2 additions & 0 deletions python/mozbuild/mozbuild/compilation/codecomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# This modules provides functionality for dealing with code completion.

from __future__ import absolute_import

import os

from mach.decorators import (
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/frontend/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

from collections import defaultdict
import os
Expand Down
2 changes: 1 addition & 1 deletion python/mozbuild/mozbuild/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import argparse
import json
Expand Down
2 changes: 1 addition & 1 deletion services/common/tests/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import mozpack.path as mozpath

Expand Down
2 changes: 2 additions & 0 deletions testing/luciddream/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

# Integrates luciddream test runner with mach.

from __future__ import absolute_import

import os

from mozbuild.base import (
Expand Down
2 changes: 1 addition & 1 deletion testing/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import os
import pprint
Expand Down
2 changes: 1 addition & 1 deletion testing/marionette/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion testing/mochitest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

from argparse import Namespace
from collections import defaultdict
Expand Down
2 changes: 1 addition & 1 deletion testing/talos/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# Integrates Talos mozharness with mach

from __future__ import print_function, unicode_literals
from __future__ import absolute_import, print_function, unicode_literals

import os
import sys
Expand Down
2 changes: 2 additions & 0 deletions testing/taskcluster/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# 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 os
import json
import copy
Expand Down
2 changes: 1 addition & 1 deletion testing/web-platform/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# 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 sys
Expand Down
2 changes: 1 addition & 1 deletion testing/xpcshell/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# 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 os
Expand Down
2 changes: 1 addition & 1 deletion tools/docs/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import os

Expand Down
2 changes: 1 addition & 1 deletion tools/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 unicode_literals
from __future__ import absolute_import, unicode_literals

import sys
import os
Expand Down
2 changes: 1 addition & 1 deletion tools/mercurial/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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 absolute_import, print_function, unicode_literals

import os
import sys
Expand Down

0 comments on commit 3e949ee

Please sign in to comment.