From f80250dda4c61c21c5c60ba29efb5d3cc629fa2a Mon Sep 17 00:00:00 2001 From: Keith Tunstead Date: Wed, 6 Nov 2019 17:05:30 +0100 Subject: [PATCH] fix BaseHandler --- pyspider/libs/base_handler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pyspider/libs/base_handler.py b/pyspider/libs/base_handler.py index 5d69d70ec..27ef123a5 100644 --- a/pyspider/libs/base_handler.py +++ b/pyspider/libs/base_handler.py @@ -264,15 +264,14 @@ def _crawl(self, url, **kwargs): if kwargs.get('callback'): callback = kwargs['callback'] - print("HERE") if isinstance(callback, six.string_types) and hasattr(self, callback): func = getattr(self, callback) - elif six.callable(callback) and hasattr(self, callback.__name__): - print("HERE2") - func = getattr(self, callback) elif six.callable(callback) and six.get_method_self(callback) is self: func = callback kwargs['callback'] = func.__name__ + elif six.callable(callback) and hasattr(self, callback.__name__): + func = getattr(self, callback) + kwargs['callback'] = func.__name__ else: raise NotImplementedError("self.%s() not implemented!" % callback) if hasattr(func, '_config'):