don't hide original exception in scrapy.utils.misc.load_object

This commit is contained in:
Mikhail Korobov 2014-09-24 13:27:14 +06:00
parent 7be3479c20
commit 5086262913
1 changed files with 1 additions and 4 deletions

View File

@ -41,10 +41,7 @@ def load_object(path):
raise ValueError("Error loading object '%s': not a full path" % path)
module, name = path[:dot], path[dot+1:]
try:
mod = import_module(module)
except ImportError as e:
raise ImportError("Error loading object '%s': %s" % (path, e))
mod = import_module(module)
try:
obj = getattr(mod, name)