mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
fix a bug. use sys.version_info.major can't be used in Python2.5
This commit is contained in:
parent
0f972df0ac
commit
ed1fa64e27
@ -301,7 +301,7 @@ def enable_parallel(processnum):
|
|||||||
global pool,cut,cut_for_search
|
global pool,cut,cut_for_search
|
||||||
if os.name=='nt':
|
if os.name=='nt':
|
||||||
raise Exception("jieba: parallel mode only supports posix system")
|
raise Exception("jieba: parallel mode only supports posix system")
|
||||||
if sys.version_info.major==2 and sys.version_info.minor<6:
|
if sys.version_info[0]==2 and sys.version_info[1]<6:
|
||||||
raise Exception("jieba: the parallel feature needs Python version>2.5 ")
|
raise Exception("jieba: the parallel feature needs Python version>2.5 ")
|
||||||
from multiprocessing import Pool,cpu_count
|
from multiprocessing import Pool,cpu_count
|
||||||
if processnum==None:
|
if processnum==None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user