From 073abd0816378ffbe6ac509587cf8034a14ccc88 Mon Sep 17 00:00:00 2001 From: noah morrison Date: Mon, 26 Jan 2015 15:13:08 -0500 Subject: [PATCH] Fix null values rendering as None. --- chevron/renderer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chevron/renderer.py b/chevron/renderer.py index 86ab624..a3d1e9d 100644 --- a/chevron/renderer.py +++ b/chevron/renderer.py @@ -59,7 +59,8 @@ def _get_key(key, scopes): # Move into the scope scope = scope[child] # Return the last scope we got - return scope + # or an empty string if falsy + return scope or '' except (TypeError, KeyError): # We couldn't find the key in the current scope # We'll try again on the next pass -- 2.47.3