Browse Source

Fix py2 token support.

tags/v0.1
Ben Kurtovic 12 years ago
parent
commit
f21f13374e
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      mwparserfromhell/parser/tokens.py

+ 2
- 2
mwparserfromhell/parser/tokens.py View File

@@ -22,7 +22,7 @@


from __future__ import unicode_literals from __future__ import unicode_literals


from ..compat import basestring, str
from ..compat import basestring, py3k, str


__all__ = ["Token"] __all__ = ["Token"]


@@ -55,7 +55,7 @@ class Token(object):


def make(name): def make(name):
__all__.append(name) __all__.append(name)
return type(name, (Token,), {})
return type(name if py3k else name.encode("utf8"), (Token,), {})


Text = make("Text") Text = make("Text")




Loading…
Cancel
Save