From 35efef41d80413481167f9a3ec779a85c7800e4b Mon Sep 17 00:00:00 2001 From: yvesf Date: Wed, 24 Nov 2010 21:14:19 +0100 Subject: catch missing multiprocessing importerror --- indexer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indexer.py') diff --git a/indexer.py b/indexer.py index 8ab4cdf..3f1ecd6 100644 --- a/indexer.py +++ b/indexer.py @@ -7,7 +7,6 @@ import pyPdf import whoosh.index as index import whoosh.writing as writing import whoosh.fields as fields -import multiprocessing as mp schema_book = fields.Schema( pagenumber=fields.NUMERIC(stored=True), @@ -97,6 +96,7 @@ def process_file(filepath): print u"{0} failed at {1}: {2}".format(os.getpid(), filepath, e) try: + import multiprocessing as mp pool = mp.Pool() jobs = [] for filepath in filepaths: -- cgit v1.2.1