Fixed string check
This commit is contained in:
parent
8086f2112e
commit
c56f8a52aa
2 changed files with 4 additions and 4 deletions
|
@ -253,7 +253,7 @@ class FeedEntry(object):
|
|||
:returns: Modification date as datetime.datetime
|
||||
'''
|
||||
if not updated is None:
|
||||
if isinstance(updated, basestr):
|
||||
if isinstance(updated, basestring):
|
||||
updated = dateutil.parser.parse(updated)
|
||||
if not isinstance(updated, datetime.datetime):
|
||||
ValueError('Invalid datetime format')
|
||||
|
@ -515,7 +515,7 @@ class FeedEntry(object):
|
|||
:returns: Creation date as datetime.datetime
|
||||
'''
|
||||
if not published is None:
|
||||
if isinstance(published, basestr):
|
||||
if isinstance(published, basestring):
|
||||
published = dateutil.parser.parse(published)
|
||||
if not isinstance(published, datetime.datetime):
|
||||
ValueError('Invalid datetime format')
|
||||
|
|
|
@ -402,7 +402,7 @@ class FeedGenerator(object):
|
|||
:returns: Modification date as datetime.datetime
|
||||
'''
|
||||
if not updated is None:
|
||||
if isinstance(updated, basestr):
|
||||
if isinstance(updated, basestring):
|
||||
updated = dateutil.parser.parse(updated)
|
||||
if not isinstance(updated, datetime.datetime):
|
||||
ValueError('Invalid datetime format')
|
||||
|
@ -817,7 +817,7 @@ class FeedGenerator(object):
|
|||
:returns: Publication date as datetime.datetime
|
||||
'''
|
||||
if not pubDate is None:
|
||||
if isinstance(pubDate, basestr):
|
||||
if isinstance(pubDate, basestring):
|
||||
pubDate = dateutil.parser.parse(pubDate)
|
||||
if not isinstance(pubDate, datetime.datetime):
|
||||
ValueError('Invalid datetime format')
|
||||
|
|
Loading…
Reference in a new issue