diff options
| author | Kali Kaneko <kali@leap.se> | 2014-02-11 01:41:51 -0400 | 
|---|---|---|
| committer | Kali Kaneko <kali@leap.se> | 2014-02-17 11:39:48 -0400 | 
| commit | 5bba9574dd0a8906178a928e4b7e8f1877a75a12 (patch) | |
| tree | ada78c16c2e867028ddf7f390d14a786a1fa547f | |
| parent | 630798ef91504b5d01ba7f673532a5875ba8c9a8 (diff) | |
catch typeerror too in empty definition
| -rw-r--r-- | mail/src/leap/mail/utils.py | 4 | 
1 files changed, 3 insertions, 1 deletions
| diff --git a/mail/src/leap/mail/utils.py b/mail/src/leap/mail/utils.py index 3ba4291..fed24b3 100644 --- a/mail/src/leap/mail/utils.py +++ b/mail/src/leap/mail/utils.py @@ -49,7 +49,7 @@ def empty(thing):          thing = thing.content      try:          return len(thing) == 0 -    except ReferenceError: +    except (ReferenceError, TypeError):          return True @@ -267,6 +267,8 @@ class CustomJsonScanner(object):          if not monkey_patched:              return self._orig_scanstring(s, idx, *args, **kwargs) +        # TODO profile to see if a compiled regex can get us some +        # benefit here.          found = False          end = s.find("\"", idx)          while not found: | 
