Fixes for feedparser v5.0
authorLindsey Smith <lindsey.smith@gmail.com>
Fri, 18 Feb 2011 01:22:32 +0000 (17:22 -0800)
committerLindsey Smith <lindsey.smith@gmail.com>
Fri, 18 Feb 2011 01:22:32 +0000 (17:22 -0800)
rss2email.py

index 40b4b4d5cfcc5b5d3c9241774dd38bcdd086b91a..d178bad30f159bb5d2e4787d2f4828ce3d5b6d2a 100644 (file)
@@ -446,7 +446,7 @@ def getEmail(r, entry):
                
        if FORCE_FROM: return DEFAULT_FROM
        
-       if r.url in OVERRIDE_EMAIL.keys():
+       if hasattr(r, "url") and r.url in OVERRIDE_EMAIL.keys():
                return validateEmail(OVERRIDE_EMAIL[r.url], DEFAULT_FROM)
        
        if 'email' in entry.get('author_detail', []):
@@ -462,7 +462,7 @@ def getEmail(r, entry):
                if feed.get("errorreportsto", ''):
                        return validateEmail(feed.errorreportsto, DEFAULT_FROM)
                        
-       if r.url in DEFAULT_EMAIL.keys():
+       if hasattr(r, "url") and r.url in DEFAULT_EMAIL.keys():
                return DEFAULT_EMAIL[r.url]
        return DEFAULT_FROM