Permalink
Browse files

Fix handling of changetype on read

  • Loading branch information...
1 parent 9d6ccd8 commit 1c256298b693c4c771f6d043318ede4c19455036 @zimeon zimeon committed Aug 24, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 resync/sitemap.py
View
9 resync/sitemap.py
@@ -326,10 +326,11 @@ def resource_from_etree(self, etree, resource_class):
if (lastmod_element is not None):
self.logger.warning("Got <lastmod> and <expires> for %s" % (loc))
# If we have a changetype, see whether we can set it
- try:
- resource.changetype = changetype
- except AttributeError as e:
- self.logger.warning("Cannot record changetype %s for %s" % (changetype,loc))
+ if (changetype is not None):
+ try:
+ resource.changetype = changetype
+ except AttributeError as e:
+ self.logger.warning("Cannot record changetype %s for %s" % (changetype,loc))
# size in bytes
size = etree.findtext('{'+RS_NS+"}size")
if (size is not None):

0 comments on commit 1c25629

Please sign in to comment.