diff --git a/mwparserfromhell/compat.py b/mwparserfromhell/compat.py new file mode 100755 index 0000000..8b3b611 --- /dev/null +++ b/mwparserfromhell/compat.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +import sys + +v = sys.version_info[0] + +if v >= 3: + bytes = bytes + str = str + basestring = (str, bytes) + import html.entities as htmlentitydefs +else: + bytes = str + str = unicode + basestring = basestring + import htmlentitydefs \ No newline at end of file