From 68a567d266328efbdf61a6bf21c13024e0563eab Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 1 Apr 2019 23:17:35 -0700 Subject: [PATCH] Perform is None check before detailed type checks. --- etiquette/photodb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etiquette/photodb.py b/etiquette/photodb.py index f82bd8e..5eca171 100644 --- a/etiquette/photodb.py +++ b/etiquette/photodb.py @@ -1103,9 +1103,9 @@ class PDBUtilMixin: return new_photo_kwargs def _normalize_new_photo_ratelimit(new_photo_ratelimit): - if isinstance(new_photo_ratelimit, ratelimiter.Ratelimiter): + if new_photo_ratelimit is None: pass - elif new_photo_ratelimit is None: + elif isinstance(new_photo_ratelimit, ratelimiter.Ratelimiter): pass elif isinstance(new_photo_ratelimit, (int, float)): new_photo_ratelimit = ratelimiter.Ratelimiter(allowance=1, period=new_photo_ratelimit)