From 283a3e2d24acddf5be2f8ceb9a534409ad35c751 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Sat, 28 Nov 2020 23:22:31 -0600 Subject: [PATCH] Use isinstance check for IgnoreConditions. --- flow/project.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flow/project.py b/flow/project.py index 7156396c4..68daec658 100644 --- a/flow/project.py +++ b/flow/project.py @@ -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 = ( @@ -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() @@ -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.