Bug 1438839 - Fix the remaining flake8 issues by hand r=ahal

MozReview-Commit-ID: Fv1MZIpCL8Z

--HG--
extra : rebase_source : 804567a78a5696997e2aa511814a4f8ff22d9c31
extra : histedit_source : 88401e831d81708b6ed6122666ba9fa8c1de23d5
This commit is contained in:
Sylvestre Ledru 2018-03-15 11:34:03 +01:00
parent ef5ad1811f
commit a0ab39f145
7 changed files with 11 additions and 22 deletions

View File

@ -5,7 +5,6 @@
from __future__ import absolute_import, print_function, unicode_literals
import os
import platform
import sys
from mach.decorators import (
@ -47,7 +46,7 @@ class Documentation(MachCommandBase):
def build_docs(self, what=None, format=None, outdir=None, auto_open=True,
http=None, archive=False, upload=False):
try:
jsdoc = which.which('jsdoc')
which.which('jsdoc')
except which.WhichError:
return die('jsdoc not found - please install from npm.')

View File

@ -11,10 +11,7 @@ from mach.decorators import (
CommandArgument,
CommandProvider,
)
from mozbuild.base import (
MachCommandBase,
MachCommandConditions as conditions,
)
from mozbuild.base import MachCommandBase
def is_osx_10_10_or_greater(cls):
@ -54,7 +51,7 @@ class MachCommands(MachCommandBase):
# password to be entered.
try:
subprocess.check_call(['sudo', 'true'])
except:
except Exception:
print('\nsudo failed; aborting')
return 1

View File

@ -12,8 +12,6 @@ import subprocess
import sys
import re
import os
import pty
import termios
from StringIO import StringIO
objdump_section_re = re.compile(
@ -255,7 +253,7 @@ file_stuff = {}
def addressToSymbol(file, address):
if not file in file_stuff:
if file not in file_stuff:
debug_file = separate_debug_file_for(file) or file
# Start an addr2line process for this file. Note that addr2line

View File

@ -55,7 +55,7 @@ address_adjustments = {}
def address_adjustment(file):
if not file in address_adjustments:
if file not in address_adjustments:
result = None
otool = subprocess.Popen(["otool", "-l", file], stdout=subprocess.PIPE)
while True:
@ -83,7 +83,7 @@ atoses = {}
def addressToSymbol(file, address):
converter = None
if not file in atoses:
if file not in atoses:
debug_file = separate_debug_file_for(file) or file
converter = unbufferedLineConverter(
'/usr/bin/xcrun', ['atos', '-arch', 'x86_64', '-o', debug_file])

View File

@ -81,7 +81,7 @@ class SymbolFile:
def addrToSymbol(self, address):
i = bisect.bisect(self.addrs, address) - 1
if i > 0:
#offset = address - self.addrs[i]
# offset = address - self.addrs[i]
return self.funcs[self.addrs[i]]
else:
return ""
@ -132,7 +132,7 @@ parsedSymbolFiles = {}
def getSymbolFile(file, symbolsDir):
p = None
if not file in parsedSymbolFiles:
if file not in parsedSymbolFiles:
symfile = guessSymbolFile(file, symbolsDir)
if symfile:
p = SymbolFile(symfile)

View File

@ -5,14 +5,10 @@
import os
import shutil
import hashlib
from os.path import join, getsize
from stat import *
import re
import sys
import getopt
import time
import datetime
import string
import tempfile
import io
@ -535,7 +531,6 @@ def create_partial_patches(patches):
partial_filename = create_partial_patch(work_dir_from, work_dir_to, patch_filename, shas, PatchInfo(work_dir, [
'update.manifest', 'updatev2.manifest', 'updatev3.manifest'], []), forced_updates, ['channel-prefs.js', 'update-settings.ini'])
partial_buildid = to_buildid
partial_shasum = hashlib.sha1(open(partial_filename, "rb").read()).hexdigest()
partial_size = str(os.path.getsize(partial_filename))

View File

@ -128,16 +128,16 @@ class TestMakeIncrementalUpdates(unittest.TestCase):
def test_bunzip_file(self):
mkup.bunzip_file('filename')
def test_extract_mar(self):
def test_extract_mar(self):
mkup.extract_mar('filename', 'work_dir')
def test_create_partial_patch_for_file(self):
mkup.create_partial_patch_for_file('from_marfile_entry', 'to_marfile_entry', 'shas', self.patch_info)
def test_create_add_patch_for_file(self):
def test_create_add_patch_for_file(self):
mkup.create_add_patch_for_file('to_marfile_entry', self.patch_info)
def test_process_explicit_remove_files(self):
def test_process_explicit_remove_files(self):
mkup.process_explicit_remove_files('dir_path', self.patch_info)
def test_create_partial_patch(self):