Merge pull request #2 from DarDar/patch-1
Use datetime instead of datetime.datetime
This commit is contained in:
commit
23ef412fcb
1 changed files with 2 additions and 2 deletions
|
@ -419,7 +419,7 @@ class FeedGenerator(object):
|
||||||
if not updated is None:
|
if not updated is None:
|
||||||
if isinstance(updated, basestring):
|
if isinstance(updated, basestring):
|
||||||
updated = dateutil.parser.parse(updated)
|
updated = dateutil.parser.parse(updated)
|
||||||
if not isinstance(updated, datetime.datetime):
|
if not isinstance(updated, datetime):
|
||||||
raise ValueError('Invalid datetime format')
|
raise ValueError('Invalid datetime format')
|
||||||
if updated.tzinfo is None:
|
if updated.tzinfo is None:
|
||||||
raise ValueError('Datetime object has no timezone info')
|
raise ValueError('Datetime object has no timezone info')
|
||||||
|
@ -834,7 +834,7 @@ class FeedGenerator(object):
|
||||||
if not pubDate is None:
|
if not pubDate is None:
|
||||||
if isinstance(pubDate, basestring):
|
if isinstance(pubDate, basestring):
|
||||||
pubDate = dateutil.parser.parse(pubDate)
|
pubDate = dateutil.parser.parse(pubDate)
|
||||||
if not isinstance(pubDate, datetime.datetime):
|
if not isinstance(pubDate, datetime):
|
||||||
raise ValueError('Invalid datetime format')
|
raise ValueError('Invalid datetime format')
|
||||||
if pubDate.tzinfo is None:
|
if pubDate.tzinfo is None:
|
||||||
raise ValueError('Datetime object has no timezone info')
|
raise ValueError('Datetime object has no timezone info')
|
||||||
|
|
Loading…
Reference in a new issue