Bug 1352599 - Follow-up: Fix Python lint errors. r=Aryx
☠☠ backed out by 64a408bde7d2 ☠ ☠
authorNick Alexander <nalexander@mozilla.com>
Thu, 12 Oct 2017 20:48:22 +0200
changeset 385923 f88b59de495270b0b04d88218a3f86b072f29442
parent 385922 b85be3749e704fe1037556e9eea72dfd0ab8c7e2
child 385924 98ae3bf088ce6b140702124d19f203e573627993
push id32672
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 09:00:05 +0000
treeherdermozilla-central@3efcb26e5f37 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersAryx
bugs1352599
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1352599 - Follow-up: Fix Python lint errors. r=Aryx
build/moz.configure/java.configure
--- a/build/moz.configure/java.configure
+++ b/build/moz.configure/java.configure
@@ -62,55 +62,62 @@ def javac_version(javac):
         version = Version(output.split(' ')[-1])
         if version < '1.8':
             die('javac 1.8 or higher is required (found %s). '
                 'Check the JAVA_HOME environment variable.' % version)
         return version
     except subprocess.CalledProcessError as e:
         die('Failed to get javac version: %s', e.output)
 
+
 # Proguard detection
 # ========================================================
 @dependable
 @imports('os')
 def proguard_jar_default():
     # By default, look for proguard.jar in the location to which `mach
     # bootstrap` or `mach artifact toolchain` will install Proguard.
-    mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
-                                        os.path.expanduser(os.path.join('~', '.mozbuild')))
+    default = os.path.expanduser(os.path.join('~', '.mozbuild'))
+    mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH', default)
     return os.path.join(mozbuild_state_dir, 'proguard', 'lib', 'proguard.jar')
 
+
 # Proguard is really required; we provide a good error message when
 # validating.
-option(env='PROGUARD_JAR', nargs=1, default=proguard_jar_default, help='Path to proguard.jar')
+option(env='PROGUARD_JAR', nargs=1, default=proguard_jar_default,
+       help='Path to proguard.jar')
+
 
 @depends(java, 'PROGUARD_JAR')
 @checking('for proguard.jar version')
 @imports('os')
 @imports('subprocess')
 # Not Python 3 compatible, but neither is the subprocess invocation.
 @imports(_from='exceptions', _import='Exception')
 def valid_proguard(java, proguard_jar):
     if not proguard_jar or not os.path.isfile(proguard_jar[0]):
-        die('proguard.jar 5.3.3 or higher is required (looked for %s). '
+        die('proguard.jar 5.3.3 or higher is required (looked for {}). '
             'Run |mach artifact install --from-build proguard-jar| or add '
-            '`export PROGUARD_JAR=/path/to/proguard.jar` to your mozconfig.' % proguard_jar[0])
+            '`export PROGUARD_JAR=/path/to/proguard.jar` to your mozconfig.'
+            .format(proguard_jar[0]))
 
     try:
         output = subprocess.check_output([java, '-jar', proguard_jar[0]])
         # Exit code zero shouldn't happen.
-        die('Expected `java -jar {}` to fail (with version in output) but got exit code 0'
+        die('Expected `java -jar {}` to fail (with version in output) '
+            'but got exit code 0'
             .format(proguard_jar[0]))
 
     except subprocess.CalledProcessError as e:
         # Exit code is non zero and output is like
         # ProGuard, version 5.3.3
         # Usage: java proguard.ProGuard [options ...]
         output = e.output
 
-    version = Version(e.output.splitlines()[0].split(' ')[-1])
+    version = Version(output.splitlines()[0].split(' ')[-1])
     if version < '5.3.3':
         die('proguard.jar 5.3.3 or higher is required (found %s). '
             'Run |mach bootstrap| to upgrade. ' % version)
 
     return proguard_jar[0]
 
+
 set_config('PROGUARD_JAR', valid_proguard)