Scrapy, a fast high-level web crawling & scraping framework for Python.
Remove six.get_method_*
Eugenio Lacuestaac62524824c5
diff --git a/scrapy/core/downloader/middleware.py b/scrapy/core/downloader/middleware.pyindex 7a6a4dfac..72432558a 100644--- a/scrapy/core/downloader/middleware.py+++ b/scrapy/core/downloader/middleware.py@@ -38,7 +38,7 @@ class DownloaderMiddlewareManager(MiddlewareManager):response = yield method(request=request, spider=spider)if response is not None and not isinstance(response, (Response, Request)):raise _InvalidOutput('Middleware %s.process_request must return None, Response or Request, got %s' % \- (six.get_method_self(method).__class__.__name__, response.__class__.__name__))+ (method.__self__.__class__.__name__, response.__class__.__name__))if response:defer.returnValue(response)defer.returnValue((yield download_func(request=request, spider=spider)))@@ -53,7 +53,7 @@ class DownloaderMiddlewareManager(MiddlewareManager):response = yield method(request=request, response=response, spider=spider)if not isinstance(response, (Response, Request)):raise _InvalidOutput('Middleware %s.process_response must return Response or Request, got %s' % \- (six.get_method_self(method).__class__.__name__, type(response)))+ (method.__self__.__class__.__name__, type(response)))if isinstance(response, Request):defer.returnValue(response)defer.returnValue(response)@@ -65,7 +65,7 @@ class DownloaderMiddlewareManager(MiddlewareManager):response = yield method(request=request, exception=exception, spider=spider)if response is not None and not isinstance(response, (Response, Request)):raise _InvalidOutput('Middleware %s.process_exception must return None, Response or Request, got %s' % \- (six.get_method_self(method).__class__.__name__, type(response)))+ (method.__self__.__class__.__name__, type(response)))if response:defer.returnValue(response)defer.returnValue(_failure)diff --git a/scrapy/core/spidermw.py b/scrapy/core/spidermw.pyindex b5f9837ff..57436d2f6 100644--- a/scrapy/core/spidermw.py+++ b/scrapy/core/spidermw.py@@ -37,8 +37,8 @@ class SpiderMiddlewareManager(MiddlewareManager):def scrape_response(self, scrape_func, response, request, spider):fname = lambda f:'%s.%s' % (- six.get_method_self(f).__class__.__name__,- six.get_method_function(f).__name__)+ f.__self__.__class__.__name__,+ f.__func__.__name__)def process_spider_input(response):for method in self.methods['process_spider_input']:diff --git a/scrapy/utils/reqser.py b/scrapy/utils/reqser.pyindex 495564ac0..e961ffca9 100644--- a/scrapy/utils/reqser.py+++ b/scrapy/utils/reqser.py@@ -87,12 +87,12 @@ def _mangle_private_name(obj, func, name):def _find_method(obj, func):if obj:try:- func_self = six.get_method_self(func)+ func_self = func.__self__except AttributeError: # func has no __self__passelse:if func_self is obj:- name = six.get_method_function(func).__name__+ name = func.__func__.__name__if _is_private_method(name):return _mangle_private_name(obj, func, name)return name