From bb0bd691d9dd42725af6291a15e357f0146de17f Mon Sep 17 00:00:00 2001 From: Valdir Stumm Junior Date: Mon, 24 Jul 2017 11:12:09 -0300 Subject: [PATCH] Improve error message when callback is not callable --- scrapy/http/request/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py index b9c5f8541..13a92ffa0 100644 --- a/scrapy/http/request/__init__.py +++ b/scrapy/http/request/__init__.py @@ -28,9 +28,9 @@ class Request(object_ref): self.priority = priority if callback is not None and not callable(callback): - raise TypeError('callback must be a function, got %s' % type(callback).__name__) + raise TypeError('callback must be a callable, got %s' % type(callback).__name__) if errback is not None and not callable(errback): - raise TypeError('errback must be a function, got %s' % type(errback).__name__) + raise TypeError('errback must be a callable, got %s' % type(errback).__name__) assert callback or not errback, "Cannot use errback without a callback" self.callback = callback self.errback = errback