allow missing field access keys in format strings (#136)
This commit is contained in:
@@ -382,11 +382,11 @@ class Formatter():
|
||||
|
||||
def _apply(self, key, funcs, fmt):
|
||||
def wrap(obj):
|
||||
if key in obj:
|
||||
try:
|
||||
obj = obj[key]
|
||||
for func in funcs:
|
||||
obj = func(obj)
|
||||
else:
|
||||
except Exception:
|
||||
obj = self.default
|
||||
return fmt(obj)
|
||||
return wrap
|
||||
|
||||
Reference in New Issue
Block a user