Explorar o código

Make representative_image Py3 compatible

Kernc %!s(int64=8) %!d(string=hai) anos
pai
achega
4b8314f5aa
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      representative_image/representative_image.py

+ 2 - 1
representative_image/representative_image.py

@@ -1,3 +1,4 @@
+import six
 from pelican import signals
 from pelican.contents import Article, Draft, Page
 from pelican.generators import ArticlesGenerator
@@ -20,7 +21,7 @@ def images_extraction(instance):
             i.extract()
         if len(images) > 0:
             # set _summary field which is based on metadata. summary field is only based on article's content and not settable
-            instance._summary = unicode(soup)
+            instance._summary = six.text_type(soup)
 
         # If there are no image in summary, look for it in the content body
         if not representativeImage: