cc-4105: fixed metadata formatting bug

This commit is contained in:
Rudi Grinberg 2012-07-30 12:37:51 -04:00
parent 6e9db647c1
commit 688d22e995
3 changed files with 11 additions and 9 deletions

View file

@ -145,10 +145,11 @@ def remove_whitespace(dictionary):
nd = copy.deepcopy(dictionary)
bad_keys = []
for k,v in nd.iteritems():
stripped = v.strip()
# ghetto and maybe unnecessary
if stripped == '' or stripped == u'':
bad_keys.append(k)
if hasattr(v,'strip'):
stripped = v.strip()
# ghetto and maybe unnecessary
if stripped == '' or stripped == u'':
bad_keys.append(k)
for bad_key in bad_keys: del nd[bad_key]
return nd