Fixed several pylint warnings on Windows.

Review URL: https://codereview.chromium.org/929183002

Cr-Original-Commit-Position: refs/heads/master@{#316527}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a0f67e034ea83f64ba12240176cd6fdd0ac8b878
This commit is contained in:
yyanagisawa 2015-02-16 20:02:21 -08:00 коммит произвёл Commit bot
Родитель bddb345373
Коммит fc4db16112
3 изменённых файлов: 10 добавлений и 15 удалений

Просмотреть файл

@ -7,6 +7,7 @@
import os
import re
import subprocess
import sys
def GetDefaultConcurrentLinks():
@ -31,8 +32,7 @@ def GetDefaultConcurrentLinks():
("sullAvailExtendedVirtual", ctypes.c_ulonglong),
]
stat = MEMORYSTATUSEX()
stat.dwLength = ctypes.sizeof(stat)
stat = MEMORYSTATUSEX(dwLength=ctypes.sizeof(MEMORYSTATUSEX))
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
mem_limit = max(1, stat.ullTotalPhys / (4 * (2 ** 30))) # total / 4GB
@ -55,7 +55,7 @@ def GetDefaultConcurrentLinks():
# A static library debug build of Chromium's unit_tests takes ~2.7GB, so
# 4GB per ld process allows for some more bloat.
return max(1, avail_bytes / (4 * (2 ** 30))) # total / 4GB
except:
except Exception:
return 1
else:
# TODO(scottmg): Implement this for other platforms.

Просмотреть файл

@ -8,15 +8,13 @@ import re
import subprocess
import sys
"""
Copies the given "win tool" (which the toolchain uses to wrap compiler
invocations) and the environment blocks for the 32-bit and 64-bit builds on
Windows to the build directory.
The arguments are the visual studio install location and the location of the
win tool. The script assumes that the root build directory is the current dir
and the files will be written to the current directory.
"""
# Copies the given "win tool" (which the toolchain uses to wrap compiler
# invocations) and the environment blocks for the 32-bit and 64-bit builds on
# Windows to the build directory.
#
# The arguments are the visual studio install location and the location of the
# win tool. The script assumes that the root build directory is the current dir
# and the files will be written to the current directory.
def _ExtractImportantEnvironment(output_of_set):
@ -104,7 +102,6 @@ def main():
'<visual studio path> <win tool path> <win sdk path> '
'<runtime dirs> <cpu_arch>')
sys.exit(2)
vs_path = sys.argv[1]
tool_source = sys.argv[2]
win_sdk_path = sys.argv[3]
runtime_dirs = sys.argv[4]

Просмотреть файл

@ -37,7 +37,6 @@ def SetEnvironmentAndGetRuntimeDllDirs():
toolchain = toolchain_data['path']
version = toolchain_data['version']
version_is_pro = version[-1] != 'e'
win8sdk = toolchain_data['win8sdk']
wdk = toolchain_data['wdk']
# TODO(scottmg): The order unfortunately matters in these. They should be
@ -168,7 +167,6 @@ def Update():
if sys.platform in ('win32', 'cygwin') and depot_tools_win_toolchain:
import find_depot_tools
depot_tools_path = find_depot_tools.add_depot_tools_to_path()
json_data_file = os.path.join(script_dir, 'win_toolchain.json')
get_toolchain_args = [
sys.executable,
os.path.join(depot_tools_path,