Commit 68c04406 authored by John Reese's avatar John Reese Committed by Facebook GitHub Bot

apply black 20.8b1 formatting update

Summary:
allow-large-files

black_any_style

Reviewed By: zertosh

Differential Revision: D24325133

fbshipit-source-id: b4afe80d1e8b2bc993f4b8e3822c02964df47462
parent 7cc28784
...@@ -207,8 +207,8 @@ class ProjectCmdBase(SubCmd): ...@@ -207,8 +207,8 @@ class ProjectCmdBase(SubCmd):
class CachedProject(object): class CachedProject(object):
""" A helper that allows calling the cache logic for a project """A helper that allows calling the cache logic for a project
from both the build and the fetch code """ from both the build and the fetch code"""
def __init__(self, cache, loader, m): def __init__(self, cache, loader, m):
self.m = m self.m = m
......
...@@ -103,17 +103,17 @@ class BuilderBase(object): ...@@ -103,17 +103,17 @@ class BuilderBase(object):
def run_tests( def run_tests(
self, install_dirs, schedule_type, owner, test_filter, retry, no_testpilot self, install_dirs, schedule_type, owner, test_filter, retry, no_testpilot
): ):
""" Execute any tests that we know how to run. If they fail, """Execute any tests that we know how to run. If they fail,
raise an exception. """ raise an exception."""
pass pass
def _build(self, install_dirs, reconfigure): def _build(self, install_dirs, reconfigure):
""" Perform the build. """Perform the build.
install_dirs contains the list of installation directories for install_dirs contains the list of installation directories for
the dependencies of this project. the dependencies of this project.
reconfigure will be set to true if the fetcher determined reconfigure will be set to true if the fetcher determined
that the sources have changed in such a way that the build that the sources have changed in such a way that the build
system needs to regenerate its rules. """ system needs to regenerate its rules."""
pass pass
def _compute_env(self, install_dirs): def _compute_env(self, install_dirs):
...@@ -575,7 +575,7 @@ if __name__ == "__main__": ...@@ -575,7 +575,7 @@ if __name__ == "__main__":
use_cmd_prefix = False use_cmd_prefix = False
def get_property(test, propname, defval=None): def get_property(test, propname, defval=None):
""" extracts a named property from a cmake test info json blob. """extracts a named property from a cmake test info json blob.
The properties look like: The properties look like:
[{"name": "WORKING_DIRECTORY"}, [{"name": "WORKING_DIRECTORY"},
{"value": "something"}] {"value": "something"}]
......
...@@ -56,18 +56,18 @@ class BuildOptions(object): ...@@ -56,18 +56,18 @@ class BuildOptions(object):
vcvars_path=None, vcvars_path=None,
allow_system_packages=False, allow_system_packages=False,
): ):
""" fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir, """fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir,
or for shipit-transformed repos, the build dir that or for shipit-transformed repos, the build dir that
has been mapped into that dir. has been mapped into that dir.
scratch_dir - a place where we can store repos and build bits. scratch_dir - a place where we can store repos and build bits.
This path should be stable across runs and ideally This path should be stable across runs and ideally
should not be in the repo of the project being built, should not be in the repo of the project being built,
but that is ultimately where we generally fall back but that is ultimately where we generally fall back
for builds outside of FB for builds outside of FB
install_dir - where the project will ultimately be installed install_dir - where the project will ultimately be installed
num_jobs - the level of concurrency to use while building num_jobs - the level of concurrency to use while building
use_shipit - use real shipit instead of the simple shipit transformer use_shipit - use real shipit instead of the simple shipit transformer
vcvars_path - Path to external VS toolchain's vsvarsall.bat vcvars_path - Path to external VS toolchain's vsvarsall.bat
""" """
if not num_jobs: if not num_jobs:
import multiprocessing import multiprocessing
......
...@@ -7,33 +7,33 @@ from __future__ import absolute_import, division, print_function, unicode_litera ...@@ -7,33 +7,33 @@ from __future__ import absolute_import, division, print_function, unicode_litera
class ArtifactCache(object): class ArtifactCache(object):
""" The ArtifactCache is a small abstraction that allows caching """The ArtifactCache is a small abstraction that allows caching
named things in some external storage mechanism. named things in some external storage mechanism.
The primary use case is for storing the build products on CI The primary use case is for storing the build products on CI
systems to accelerate the build """ systems to accelerate the build"""
def download_to_file(self, name, dest_file_name): def download_to_file(self, name, dest_file_name):
""" If `name` exists in the cache, download it and place it """If `name` exists in the cache, download it and place it
in the specified `dest_file_name` location on the filesystem. in the specified `dest_file_name` location on the filesystem.
If a transient issue was encountered a TransientFailure shall If a transient issue was encountered a TransientFailure shall
be raised. be raised.
If `name` doesn't exist in the cache `False` shall be returned. If `name` doesn't exist in the cache `False` shall be returned.
If `dest_file_name` was successfully updated `True` shall be If `dest_file_name` was successfully updated `True` shall be
returned. returned.
All other conditions shall raise an appropriate exception. """ All other conditions shall raise an appropriate exception."""
return False return False
def upload_from_file(self, name, source_file_name): def upload_from_file(self, name, source_file_name):
""" Causes `name` to be populated in the cache by uploading """Causes `name` to be populated in the cache by uploading
the contents of `source_file_name` to the storage system. the contents of `source_file_name` to the storage system.
If a transient issue was encountered a TransientFailure shall If a transient issue was encountered a TransientFailure shall
be raised. be raised.
If the upload failed for some other reason, an appropriate If the upload failed for some other reason, an appropriate
exception shall be raised. """ exception shall be raised."""
pass pass
def create_cache(): def create_cache():
""" This function is monkey patchable to provide an actual """This function is monkey patchable to provide an actual
implementation """ implementation"""
return None return None
...@@ -48,11 +48,11 @@ def find_eden_root(dirpath): ...@@ -48,11 +48,11 @@ def find_eden_root(dirpath):
def prefetch_dir_if_eden(dirpath): def prefetch_dir_if_eden(dirpath):
""" After an amend/rebase, Eden may need to fetch a large number """After an amend/rebase, Eden may need to fetch a large number
of trees from the servers. The simplistic single threaded walk of trees from the servers. The simplistic single threaded walk
performed by copytree makes this more expensive than is desirable performed by copytree makes this more expensive than is desirable
so we help accelerate things by performing a prefetch on the so we help accelerate things by performing a prefetch on the
source directory """ source directory"""
global PREFETCHED_DIRS global PREFETCHED_DIRS
if dirpath in PREFETCHED_DIRS: if dirpath in PREFETCHED_DIRS:
return return
...@@ -68,7 +68,7 @@ def prefetch_dir_if_eden(dirpath): ...@@ -68,7 +68,7 @@ def prefetch_dir_if_eden(dirpath):
def copytree(src_dir, dest_dir, ignore=None): def copytree(src_dir, dest_dir, ignore=None):
""" Recursively copy the src_dir to the dest_dir, filtering """Recursively copy the src_dir to the dest_dir, filtering
out entries using the ignore lambda. The behavior of the out entries using the ignore lambda. The behavior of the
ignore lambda must match that described by `shutil.copytree`. ignore lambda must match that described by `shutil.copytree`.
This `copytree` function knows how to prefetch data when This `copytree` function knows how to prefetch data when
......
...@@ -121,10 +121,10 @@ class Env(object): ...@@ -121,10 +121,10 @@ class Env(object):
def add_path_entry(env, name, item, append=True, separator=os.pathsep): def add_path_entry(env, name, item, append=True, separator=os.pathsep):
""" Cause `item` to be added to the path style env var named """Cause `item` to be added to the path style env var named
`name` held in the `env` dict. `append` specifies whether `name` held in the `env` dict. `append` specifies whether
the item is added to the end (the default) or should be the item is added to the end (the default) or should be
prepended if `name` already exists. """ prepended if `name` already exists."""
val = env.get(name, "") val = env.get(name, "")
if len(val) > 0: if len(val) > 0:
val = val.split(separator) val = val.split(separator)
...@@ -138,10 +138,10 @@ def add_path_entry(env, name, item, append=True, separator=os.pathsep): ...@@ -138,10 +138,10 @@ def add_path_entry(env, name, item, append=True, separator=os.pathsep):
def add_flag(env, name, flag, append=True): def add_flag(env, name, flag, append=True):
""" Cause `flag` to be added to the CXXFLAGS-style env var named """Cause `flag` to be added to the CXXFLAGS-style env var named
`name` held in the `env` dict. `append` specifies whether the `name` held in the `env` dict. `append` specifies whether the
flag is added to the end (the default) or should be prepended if flag is added to the end (the default) or should be prepended if
`name` already exists. """ `name` already exists."""
val = shlex.split(env.get(name, "")) val = shlex.split(env.get(name, ""))
if append: if append:
val.append(flag) val.append(flag)
...@@ -155,11 +155,11 @@ _not_found = object() ...@@ -155,11 +155,11 @@ _not_found = object()
def path_search(env, exename, defval=None): def path_search(env, exename, defval=None):
""" Search for exename in the PATH specified in env. """Search for exename in the PATH specified in env.
exename is eg: `ninja` and this function knows to append a .exe exename is eg: `ninja` and this function knows to append a .exe
to the end on windows. to the end on windows.
Returns the path to the exe if found, or None if either no Returns the path to the exe if found, or None if either no
PATH is set in env or no executable is found. """ PATH is set in env or no executable is found."""
path = env.get("PATH", None) path = env.get("PATH", None)
if path is None: if path is None:
......
...@@ -7,9 +7,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera ...@@ -7,9 +7,9 @@ from __future__ import absolute_import, division, print_function, unicode_litera
class TransientFailure(Exception): class TransientFailure(Exception):
""" Raising this error causes getdeps to return with an error code """Raising this error causes getdeps to return with an error code
that Sandcastle will consider to be a retryable transient that Sandcastle will consider to be a retryable transient
infrastructure error """ infrastructure error"""
pass pass
......
...@@ -10,7 +10,7 @@ import shlex ...@@ -10,7 +10,7 @@ import shlex
def parse_expr(expr_text, valid_variables): def parse_expr(expr_text, valid_variables):
""" parses the simple criteria expression syntax used in """parses the simple criteria expression syntax used in
dependency specifications. dependency specifications.
Returns an ExprNode instance that can be evaluated like this: Returns an ExprNode instance that can be evaluated like this:
......
...@@ -46,7 +46,7 @@ def file_name_is_cmake_file(file_name): ...@@ -46,7 +46,7 @@ def file_name_is_cmake_file(file_name):
class ChangeStatus(object): class ChangeStatus(object):
""" Indicates the nature of changes that happened while updating """Indicates the nature of changes that happened while updating
the source directory. There are two broad uses: the source directory. There are two broad uses:
* When extracting archives for third party software we want to * When extracting archives for third party software we want to
know that we did something (eg: we either extracted code or know that we did something (eg: we either extracted code or
...@@ -59,9 +59,9 @@ class ChangeStatus(object): ...@@ -59,9 +59,9 @@ class ChangeStatus(object):
""" """
def __init__(self, all_changed=False): def __init__(self, all_changed=False):
""" Construct a ChangeStatus object. The default is to create """Construct a ChangeStatus object. The default is to create
a status that indicates no changes, but passing all_changed=True a status that indicates no changes, but passing all_changed=True
will create one that indicates that everything changed """ will create one that indicates that everything changed"""
if all_changed: if all_changed:
self.source_files = 1 self.source_files = 1
self.make_files = 1 self.make_files = 1
...@@ -70,7 +70,7 @@ class ChangeStatus(object): ...@@ -70,7 +70,7 @@ class ChangeStatus(object):
self.make_files = 0 self.make_files = 0
def record_change(self, file_name): def record_change(self, file_name):
""" Used by the shipit fetcher to record changes as it updates """Used by the shipit fetcher to record changes as it updates
files in the destination. If the file name might be one used files in the destination. If the file name might be one used
in the cmake build system that we use for 1st party code, then in the cmake build system that we use for 1st party code, then
record that as a "make file" change. We could broaden this record that as a "make file" change. We could broaden this
...@@ -79,7 +79,7 @@ class ChangeStatus(object): ...@@ -79,7 +79,7 @@ class ChangeStatus(object):
If the file isn't a build file and is under the `fbcode_builder` If the file isn't a build file and is under the `fbcode_builder`
dir then we don't class that as an interesting change that we dir then we don't class that as an interesting change that we
might need to rebuild, so we ignore it. might need to rebuild, so we ignore it.
Otherwise we record the file as a source file change. """ Otherwise we record the file as a source file change."""
file_name = file_name.lower() file_name = file_name.lower()
if file_name_is_cmake_file(file_name): if file_name_is_cmake_file(file_name):
...@@ -90,41 +90,41 @@ class ChangeStatus(object): ...@@ -90,41 +90,41 @@ class ChangeStatus(object):
self.source_files += 1 self.source_files += 1
def sources_changed(self): def sources_changed(self):
""" Returns true if any source files were changed during """Returns true if any source files were changed during
an update operation. This will typically be used to decide an update operation. This will typically be used to decide
that the build system to be run on the source dir in an that the build system to be run on the source dir in an
incremental mode """ incremental mode"""
return self.source_files > 0 return self.source_files > 0
def build_changed(self): def build_changed(self):
""" Returns true if any build files were changed during """Returns true if any build files were changed during
an update operation. This will typically be used to decidfe an update operation. This will typically be used to decidfe
that the build system should be reconfigured and re-run that the build system should be reconfigured and re-run
as a full build """ as a full build"""
return self.make_files > 0 return self.make_files > 0
class Fetcher(object): class Fetcher(object):
""" The Fetcher is responsible for fetching and extracting the """The Fetcher is responsible for fetching and extracting the
sources for project. The Fetcher instance defines where the sources for project. The Fetcher instance defines where the
extracted data resides and reports this to the consumer via extracted data resides and reports this to the consumer via
its `get_src_dir` method. """ its `get_src_dir` method."""
def update(self): def update(self):
""" Brings the src dir up to date, ideally minimizing """Brings the src dir up to date, ideally minimizing
changes so that a subsequent build doesn't over-build. changes so that a subsequent build doesn't over-build.
Returns a ChangeStatus object that helps the caller to Returns a ChangeStatus object that helps the caller to
understand the nature of the changes required during understand the nature of the changes required during
the update. """ the update."""
return ChangeStatus() return ChangeStatus()
def clean(self): def clean(self):
""" Reverts any changes that might have been made to """Reverts any changes that might have been made to
the src dir """ the src dir"""
pass pass
def hash(self): def hash(self):
""" Returns a hash that identifies the version of the code in the """Returns a hash that identifies the version of the code in the
working copy. For a git repo this is commit hash for the working working copy. For a git repo this is commit hash for the working
copy. For other Fetchers this should relate to the version of copy. For other Fetchers this should relate to the version of
the code in the src dir. The intent is that if a manifest the code in the src dir. The intent is that if a manifest
...@@ -137,17 +137,17 @@ class Fetcher(object): ...@@ -137,17 +137,17 @@ class Fetcher(object):
pass pass
def get_src_dir(self): def get_src_dir(self):
""" Returns the source directory that the project was """Returns the source directory that the project was
extracted into """ extracted into"""
pass pass
class LocalDirFetcher(object): class LocalDirFetcher(object):
""" This class exists to override the normal fetching behavior, and """This class exists to override the normal fetching behavior, and
use an explicit user-specified directory for the project sources. use an explicit user-specified directory for the project sources.
This fetcher cannot update or track changes. It always reports that the This fetcher cannot update or track changes. It always reports that the
project has changed, forcing it to always be built. """ project has changed, forcing it to always be built."""
def __init__(self, path): def __init__(self, path):
self.path = os.path.realpath(path) self.path = os.path.realpath(path)
...@@ -337,9 +337,9 @@ def does_file_need_update(src_name, src_st, dest_name): ...@@ -337,9 +337,9 @@ def does_file_need_update(src_name, src_st, dest_name):
def copy_if_different(src_name, dest_name): def copy_if_different(src_name, dest_name):
""" Copy src_name -> dest_name, but only touch dest_name """Copy src_name -> dest_name, but only touch dest_name
if src_name is different from dest_name, making this a if src_name is different from dest_name, making this a
more build system friendly way to copy. """ more build system friendly way to copy."""
src_st = os.lstat(src_name) src_st = os.lstat(src_name)
if not does_file_need_update(src_name, src_st, dest_name): if not does_file_need_update(src_name, src_st, dest_name):
return False return False
...@@ -379,9 +379,9 @@ class ShipitPathMap(object): ...@@ -379,9 +379,9 @@ class ShipitPathMap(object):
self.exclusion = [] self.exclusion = []
def add_mapping(self, fbsource_dir, target_dir): def add_mapping(self, fbsource_dir, target_dir):
""" Add a posix path or pattern. We cannot normpath the input """Add a posix path or pattern. We cannot normpath the input
here because that would change the paths from posix to windows here because that would change the paths from posix to windows
form and break the logic throughout this class. """ form and break the logic throughout this class."""
self.roots.append(fbsource_dir) self.roots.append(fbsource_dir)
self.mapping.append((fbsource_dir, target_dir)) self.mapping.append((fbsource_dir, target_dir))
...@@ -389,9 +389,9 @@ class ShipitPathMap(object): ...@@ -389,9 +389,9 @@ class ShipitPathMap(object):
self.exclusion.append(re.compile(pattern)) self.exclusion.append(re.compile(pattern))
def _minimize_roots(self): def _minimize_roots(self):
""" compute the de-duplicated set of roots within fbsource. """compute the de-duplicated set of roots within fbsource.
We take the shortest common directory prefix to make this We take the shortest common directory prefix to make this
determination """ determination"""
self.roots.sort(key=len) self.roots.sort(key=len)
minimized = [] minimized = []
...@@ -496,10 +496,10 @@ FBSOURCE_REPO_DATA: Dict[str, FbsourceRepoData] = {} ...@@ -496,10 +496,10 @@ FBSOURCE_REPO_DATA: Dict[str, FbsourceRepoData] = {}
def get_fbsource_repo_data(build_options): def get_fbsource_repo_data(build_options):
""" Returns the commit metadata for the fbsource repo. """Returns the commit metadata for the fbsource repo.
Since we may have multiple first party projects to Since we may have multiple first party projects to
hash, and because we don't mutate the repo, we cache hash, and because we don't mutate the repo, we cache
this hash in a global. """ this hash in a global."""
cached_data = FBSOURCE_REPO_DATA.get(build_options.fbsource_dir) cached_data = FBSOURCE_REPO_DATA.get(build_options.fbsource_dir)
if cached_data: if cached_data:
return cached_data return cached_data
......
...@@ -103,8 +103,8 @@ def patch_loader(namespace, manifests_dir="manifests"): ...@@ -103,8 +103,8 @@ def patch_loader(namespace, manifests_dir="manifests"):
def load_project(build_opts, project_name): def load_project(build_opts, project_name):
""" given the name of a project or a path to a manifest file, """given the name of a project or a path to a manifest file,
load up the ManifestParser instance for it and return it """ load up the ManifestParser instance for it and return it"""
return LOADER.load_project(build_opts, project_name) return LOADER.load_project(build_opts, project_name)
...@@ -113,7 +113,7 @@ def load_all_manifests(build_opts): ...@@ -113,7 +113,7 @@ def load_all_manifests(build_opts):
class ManifestLoader(object): class ManifestLoader(object):
""" ManifestLoader stores information about project manifest relationships for a """ManifestLoader stores information about project manifest relationships for a
given set of (build options + platform) configuration. given set of (build options + platform) configuration.
The ManifestLoader class primarily serves as a location to cache project dependency The ManifestLoader class primarily serves as a location to cache project dependency
...@@ -159,7 +159,7 @@ class ManifestLoader(object): ...@@ -159,7 +159,7 @@ class ManifestLoader(object):
return self.manifests_by_name return self.manifests_by_name
def manifests_in_dependency_order(self, manifest=None): def manifests_in_dependency_order(self, manifest=None):
""" Compute all dependencies of the specified project. Returns a list of the """Compute all dependencies of the specified project. Returns a list of the
dependencies plus the project itself, in topologically sorted order. dependencies plus the project itself, in topologically sorted order.
Each entry in the returned list only depends on projects that appear before it Each entry in the returned list only depends on projects that appear before it
...@@ -168,7 +168,7 @@ class ManifestLoader(object): ...@@ -168,7 +168,7 @@ class ManifestLoader(object):
If the input manifest is None, the dependencies for all currently loaded If the input manifest is None, the dependencies for all currently loaded
projects will be computed. i.e., if you call load_all_manifests() followed by projects will be computed. i.e., if you call load_all_manifests() followed by
manifests_in_dependency_order() this will return a global dependency ordering of manifests_in_dependency_order() this will return a global dependency ordering of
all projects. """ all projects."""
# The list of deps that have been fully processed # The list of deps that have been fully processed
seen = set() seen = set()
# The list of deps which have yet to be evaluated. This # The list of deps which have yet to be evaluated. This
...@@ -258,12 +258,12 @@ class ManifestLoader(object): ...@@ -258,12 +258,12 @@ class ManifestLoader(object):
return h return h
def _compute_project_hash(self, manifest): def _compute_project_hash(self, manifest):
""" This recursive function computes a hash for a given manifest. """This recursive function computes a hash for a given manifest.
The hash takes into account some environmental factors on the The hash takes into account some environmental factors on the
host machine and includes the hashes of its dependencies. host machine and includes the hashes of its dependencies.
No caching of the computation is performed, which is theoretically No caching of the computation is performed, which is theoretically
wasteful but the computation is fast enough that it is not required wasteful but the computation is fast enough that it is not required
to cache across multiple invocations. """ to cache across multiple invocations."""
ctx = self.ctx_gen.get_context(manifest.name) ctx = self.ctx_gen.get_context(manifest.name)
hasher = hashlib.sha256() hasher = hashlib.sha256()
......
...@@ -242,7 +242,7 @@ class ManifestParser(object): ...@@ -242,7 +242,7 @@ class ManifestParser(object):
return defval return defval
def get_section_as_args(self, section, ctx=None): def get_section_as_args(self, section, ctx=None):
""" Intended for use with the make.[build_args/install_args] and """Intended for use with the make.[build_args/install_args] and
autoconf.args sections, this method collects the entries and returns an autoconf.args sections, this method collects the entries and returns an
array of strings. array of strings.
If the manifest contains conditional sections, ctx is used to If the manifest contains conditional sections, ctx is used to
...@@ -267,8 +267,8 @@ class ManifestParser(object): ...@@ -267,8 +267,8 @@ class ManifestParser(object):
return args return args
def get_section_as_ordered_pairs(self, section, ctx=None): def get_section_as_ordered_pairs(self, section, ctx=None):
""" Used for eg: shipit.pathmap which has strong """Used for eg: shipit.pathmap which has strong
ordering requirements """ ordering requirements"""
res = [] res = []
ctx = ctx or {} ctx = ctx or {}
...@@ -302,13 +302,13 @@ class ManifestParser(object): ...@@ -302,13 +302,13 @@ class ManifestParser(object):
return d return d
def update_hash(self, hasher, ctx): def update_hash(self, hasher, ctx):
""" Compute a hash over the configuration for the given """Compute a hash over the configuration for the given
context. The goal is for the hash to change if the config context. The goal is for the hash to change if the config
for that context changes, but not if a change is made to for that context changes, but not if a change is made to
the config only for a different platform than that expressed the config only for a different platform than that expressed
by ctx. The hash is intended to be used to help invalidate by ctx. The hash is intended to be used to help invalidate
a future cache for the third party build products. a future cache for the third party build products.
The hasher argument is a hash object returned from hashlib. """ The hasher argument is a hash object returned from hashlib."""
for section in sorted(SCHEMA.keys()): for section in sorted(SCHEMA.keys()):
hasher.update(section.encode("utf-8")) hasher.update(section.encode("utf-8"))
...@@ -521,7 +521,7 @@ class ManifestParser(object): ...@@ -521,7 +521,7 @@ class ManifestParser(object):
class ManifestContext(object): class ManifestContext(object):
""" ProjectContext contains a dictionary of values to use when evaluating boolean """ProjectContext contains a dictionary of values to use when evaluating boolean
expressions in a project manifest. expressions in a project manifest.
This object should be passed as the `ctx` parameter in ManifestParser.get() calls. This object should be passed as the `ctx` parameter in ManifestParser.get() calls.
...@@ -551,10 +551,10 @@ class ManifestContext(object): ...@@ -551,10 +551,10 @@ class ManifestContext(object):
class ContextGenerator(object): class ContextGenerator(object):
""" ContextGenerator allows creating ManifestContext objects on a per-project basis. """ContextGenerator allows creating ManifestContext objects on a per-project basis.
This allows us to evaluate different projects with slightly different contexts. This allows us to evaluate different projects with slightly different contexts.
For instance, this can be used to only enable tests for some projects. """ For instance, this can be used to only enable tests for some projects."""
def __init__(self, default_ctx): def __init__(self, default_ctx):
self.default_ctx = ManifestContext(default_ctx) self.default_ctx = ManifestContext(default_ctx)
......
...@@ -11,8 +11,8 @@ import sys ...@@ -11,8 +11,8 @@ import sys
def is_windows(): def is_windows():
""" Returns true if the system we are currently running on """Returns true if the system we are currently running on
is a Windows system """ is a Windows system"""
return sys.platform.startswith("win") return sys.platform.startswith("win")
......
...@@ -435,8 +435,8 @@ class Deadlock(gdb.Command): ...@@ -435,8 +435,8 @@ class Deadlock(gdb.Command):
# Go through all the blocked threads and see which threads # Go through all the blocked threads and see which threads
# they are blocked on, and build the thread wait graph. # they are blocked on, and build the thread wait graph.
for thread_lwp, mutex_type in blocked_threads.items(): for thread_lwp, mutex_type in blocked_threads.items():
get_owner_and_address_func = MutexType.get_mutex_owner_and_address_func_for_type( get_owner_and_address_func = (
mutex_type MutexType.get_mutex_owner_and_address_func_for_type(mutex_type)
) )
if not get_owner_and_address_func: if not get_owner_and_address_func:
continue continue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment