From 0f972df0ac13ed6f16d30b61d8c44a37568c3996 Mon Sep 17 00:00:00 2001 From: Sun Junyi Date: Mon, 29 Jul 2013 10:01:47 +0800 Subject: [PATCH] raise exception in case of lower version --- jieba/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jieba/__init__.py b/jieba/__init__.py index a59543d..089ee48 100644 --- a/jieba/__init__.py +++ b/jieba/__init__.py @@ -301,7 +301,8 @@ def enable_parallel(processnum): global pool,cut,cut_for_search if os.name=='nt': raise Exception("jieba: parallel mode only supports posix system") - + if sys.version_info.major==2 and sys.version_info.minor<6: + raise Exception("jieba: the parallel feature needs Python version>2.5 ") from multiprocessing import Pool,cpu_count if processnum==None: processnum = cpu_count()