From: noah morrison Date: Mon, 26 Jan 2015 20:57:28 +0000 (-0500) Subject: Fix 0 and False values not rendering. X-Git-Url: https://git.devinivas.org/?a=commitdiff_plain;h=01b6fb9f14e1d883df3b8a62e32423233543b4bf;p=chevron.git Fix 0 and False values not rendering. 0 and False should still be rendered, even though they are falsy. --- diff --git a/chevron/renderer.py b/chevron/renderer.py index a3d1e9d..7a3d93d 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -60,6 +60,12 @@ def _get_key(key, scopes): scope = scope[child] # Return the last scope we got # or an empty string if falsy + + if scope is 0: + return 0 + if scope is False: + return False + return scope or '' except (TypeError, KeyError): # We couldn't find the key in the current scope