Skip to content

Commit f4bb86e

Browse files
Merge pull request #1 from puentesarrin/non_standard-xmlns
Handle non-standard xmlns declaration and bump 0.2.2 version.
2 parents 99e469e + 3ef962c commit f4bb86e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

speedparser/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .speedparser import parse
2-
VERSION = (0,2,1)
2+
VERSION = (0,2,2)
33
__all__ = ['parse', 'VERSION']

speedparser/speedparser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,10 @@ def parse_version(self):
606606
if not (value.startswith('atom') and root_tag == 'rss'):
607607
return value
608608
elif self.xmlns:
609-
vers = self.xmlns.split('/')[-2].replace('.', '')
609+
try:
610+
vers = self.xmlns.split('/')[-2].replace('.', '')
611+
except IndexError:
612+
vers = ''
610613
tag = root_tag
611614
if r.attrib.get('version', None):
612615
vers = r.attrib['version'].replace('.', '')

0 commit comments

Comments
 (0)