Permalink
Browse files

BloggerEntry.get_blog_id(): return None when blog id can't be parsed

background in bridgy/issues#147
  • Loading branch information...
snarfed committed May 24, 2014
1 parent ce1a544 commit 8453e3388d152ac650e22d219fae36da56d9a85d
Showing with 4 additions and 5 deletions.
  1. +4 −5 src/gdata/blogger/data.py
@@ -54,13 +54,12 @@ def get_blog_id(self):
Returns:
The blog's unique id as a string.
"""
- if self.id.text:
- match = BLOG_ID_PATTERN.match(self.id.text)
+ if not self.id.text:
+ return None
+ for pattern in BLOG_ID_PATTERN, BLOG_ID2_PATTERN:
+ match = pattern.match(self.id.text)
if match:
return match.group(2)
- else:
- return BLOG_ID2_PATTERN.match(self.id.text).group(2)
- return None
GetBlogId = get_blog_id

0 comments on commit 8453e33

Please sign in to comment.