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

Use isinstance with IgnoreConditions. #378

Merged
merged 1 commit into from
Dec 3, 2020
Merged
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
12 changes: 6 additions & 6 deletions flow/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,10 @@ def _eligible(self, jobs, ignore_conditions=IgnoreConditions.NONE):
:type ignore_conditions:
:py:class:`~.IgnoreConditions`
"""
if type(ignore_conditions) != IgnoreConditions:
if not isinstance(ignore_conditions, IgnoreConditions):
raise ValueError(
"The ignore_conditions argument of FlowProject.run() "
"must be a member of class IgnoreConditions"
"must be a member of class IgnoreConditions."
)
# len(self._prereqs) check for speed optimization
pre = (
Expand Down Expand Up @@ -3030,10 +3030,10 @@ def run(
if num and num < 0:
num = None

if type(ignore_conditions) != IgnoreConditions:
if not isinstance(ignore_conditions, IgnoreConditions):
raise ValueError(
"The ignore_conditions argument of FlowProject.run() "
"must be a member of class IgnoreConditions"
"must be a member of class IgnoreConditions."
)

messages = list()
Expand Down Expand Up @@ -3641,10 +3641,10 @@ def submit(
"hours component: datetime.timedelta"
):
raise
if type(ignore_conditions) != IgnoreConditions:
if not isinstance(ignore_conditions, IgnoreConditions):
raise ValueError(
"The ignore_conditions argument of FlowProject.run() "
"must be a member of class IgnoreConditions"
"must be a member of class IgnoreConditions."
)

# Gather all pending operations.
Expand Down