restored code removed in r118. there's nothing wrong with that code

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40120
This commit is contained in:
Pablo Hoffman 2008-07-25 21:28:49 +00:00
parent c97c495d16
commit 67ee6bff2e
1 changed files with 7 additions and 1 deletions

View File

@ -20,7 +20,13 @@ class Settings(object):
self.core = self._import('scrapy.conf.core_settings')
def _import(self, modulepath):
return __import__(modulepath, {}, {}, [''])
try:
return __import__(modulepath, {}, {}, [''])
except ImportError:
import sys
err = "Error: Can't find %s module in your python path\n"
sys.stderr.write(err % modulepath)
sys.exit(1)
def __getitem__(self, opt_name):
if opt_name in self.overrides: