]> Devi Nivas Git - chevron.git/commitdiff
Add specific check for zero and False since False == 0 is True.
authorKarthikeyan Singaravelan <tir.karthi@gmail.com>
Fri, 1 May 2020 04:38:30 +0000 (04:38 +0000)
committerKarthikeyan Singaravelan <tir.karthi@gmail.com>
Fri, 1 May 2020 04:38:30 +0000 (04:38 +0000)
chevron/renderer.py

index 58817eff862fc1292d186383f852fd41684e7b61..ce21f51f2b877df88b07c023035392d5a00154bf 100644 (file)
@@ -74,10 +74,8 @@ def _get_key(key, scopes):
 
             # Return an empty string if falsy, with two exceptions
             # 0 should return 0, and False should return False
-            if scope == 0:
-                return 0
-            if scope is False:
-                return False
+            if scope in (0, False):
+                return scope
 
             try:
                 # This allows for custom falsy data types