From 4741946eda8ff2946cff6943522b387112fe5a9b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 18 May 2021 23:26:44 -0700 Subject: [PATCH] Do None check before isinstance check. --- voussoirkit/spinal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/voussoirkit/spinal.py b/voussoirkit/spinal.py index 2ea7783..3759a8e 100644 --- a/voussoirkit/spinal.py +++ b/voussoirkit/spinal.py @@ -685,12 +685,12 @@ def limiter_or_none(value): Returns a Ratelimiter object if the argument can be normalized to one, or None if the argument is None. Saves the caller from having to if. ''' - if isinstance(value, ratelimiter.Ratelimiter): - return value - if value is None: return None + if isinstance(value, ratelimiter.Ratelimiter): + return value + if isinstance(value, str): value = bytestring.parsebytes(value)