diff --git a/python/src/mapreduce/base_handler.py b/python/src/mapreduce/base_handler.py index bc3fb727..3b6d6430 100755 --- a/python/src/mapreduce/base_handler.py +++ b/python/src/mapreduce/base_handler.py @@ -23,16 +23,19 @@ import httplib import logging +import pkgutil +import importlib try: import json except ImportError: import simplejson as json -try: - from mapreduce import pipeline_base -except ImportError: - pipeline_base = None +pipeline_base = None + +if pkgutil.find_loader('mapreduce.pipeline_base') is not None: + pipeline_base = importlib.import_module('mapreduce.pipeline_base') + try: # Check if the full cloudstorage package exists. The stub part is in runtime. import cloudstorage