瀏覽代碼

Delay loading of pure Python tokenizer

tags/v0.4.1
John Vandenberg 9 年之前
父節點
當前提交
ab0a58121a
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      mwparserfromhell/parser/__init__.py

+ 2
- 1
mwparserfromhell/parser/__init__.py 查看文件

@@ -40,11 +40,11 @@ class ParserError(Exception):


from .builder import Builder
from .tokenizer import Tokenizer
try:
from ._tokenizer import CTokenizer
use_c = True
except ImportError:
from .tokenizer import Tokenizer
CTokenizer = None
use_c = False

@@ -70,6 +70,7 @@ class Parser(object):
if use_c and CTokenizer:
self._tokenizer = CTokenizer()
else:
from .tokenizer import Tokenizer
self._tokenizer = Tokenizer()
self._builder = Builder()



Loading…
取消
儲存