Explorar o código

Add support for python3 in liquid_tags/b64img.py

The following error occured when used with python3

ImportError: No module named 'urllib2'
Alexandre Norman %!s(int64=6) %!d(string=hai) anos
pai
achega
033ddd95c2
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      liquid_tags/b64img.py

+ 4 - 1
liquid_tags/b64img.py

@@ -24,7 +24,10 @@ Output
 """
 import re
 import base64
-import urllib2
+try:
+    import urllib.request as urllib2
+except ImportError:
+    import urllib2
 from .mdx_liquid_tags import LiquidTags
 import six