From 10fb9ced692c3770e9522e0959cd4eed335caeea Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Fri, 1 May 2020 04:38:30 +0000 Subject: [PATCH] Add specific check for zero and False since False == 0 is True. --- chevron/renderer.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chevron/renderer.py b/chevron/renderer.py index 58817ef..ce21f51 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -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 -- 2.47.3