Sfoglia il codice sorgente

Fix py2 token support.

tags/v0.1
Ben Kurtovic 12 anni fa
parent
commit
f21f13374e
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. +2
    -2
      mwparserfromhell/parser/tokens.py

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

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

from __future__ import unicode_literals

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

__all__ = ["Token"]

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

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

Text = make("Text")



Caricamento…
Annulla
Salva