Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STY: Apply ruff/flake8-bugbear rules (B) #3671

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nipype/interfaces/utility/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(

super().__init__(**inputs)
if function:
if hasattr(function, "__call__"):
if callable(function):
try:
self.inputs.function_str = getsource(function)
except OSError:
Expand Down Expand Up @@ -103,7 +103,7 @@ def __init__(

def _set_function_string(self, obj, name, old, new):
if name == "function_str":
if hasattr(new, "__call__"):
if callable(new):
function_source = getsource(new)
fninfo = new.__code__
elif isinstance(new, (str, bytes)):
Expand Down
2 changes: 1 addition & 1 deletion nipype/pipeline/plugins/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, plugin_args=None):
if (
plugin_args
and "callable" in plugin_args
and hasattr(plugin_args["callable"], "__call__")
and callable(plugin_args["callable"])
):
self._callable = plugin_args["callable"]
else:
Expand Down
Loading