Skip to content

Commit

Permalink
fix for programmes with no desc element
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerrichey committed Aug 20, 2017
1 parent 2486683 commit 0bc3e16
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Contents/Code/xmltv_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,15 @@ def LoadGuide():
title = title_text.decode('utf-8')
else:
title = None
desc_text = programme_elem.find('desc').text
if desc_text:
try:
desc = unicode(desc_text, errors = 'replace')
except TypeError:
desc = desc_text.decode('utf-8')
if programme_elem.find('desc'):
desc_text = programme_elem.find('desc').text
if dest_text:
try:
desc = unicode(desc_text, errors = 'replace')
except TypeError:
desc = desc_text.decode('utf-8')
else:
desc = None
else:
desc = None
count = count + 1
Expand Down

0 comments on commit 0bc3e16

Please sign in to comment.