From a2602df90b6954b6e764ab2b49d897fc2cdb0457 Mon Sep 17 00:00:00 2001 From: Rolando Espinoza La fuente Date: Wed, 21 Nov 2012 10:44:35 -0400 Subject: [PATCH] httpcache: allow to import submodules within packages as HTTPCACHE_DBM_MODULE setting. --- scrapy/contrib/httpcache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy/contrib/httpcache.py b/scrapy/contrib/httpcache.py index 0891c6355..49e82dc8c 100644 --- a/scrapy/contrib/httpcache.py +++ b/scrapy/contrib/httpcache.py @@ -163,7 +163,8 @@ class DbmCacheStorage(object): def __init__(self, settings): self.cachedir = data_path(settings['HTTPCACHE_DIR'], createdir=True) self.expiration_secs = settings.getint('HTTPCACHE_EXPIRATION_SECS') - self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE']) + self.dbmodule = __import__(settings['HTTPCACHE_DBM_MODULE'], + {}, {}, ['']) self.db = None def open_spider(self, spider):