Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

fix new detected flake8 cases

marc8971878c1d4d
diff --git a/scrapy/core/spidermw.py b/scrapy/core/spidermw.py
index 87d08cab7..35264a92b 100644
--- a/scrapy/core/spidermw.py
+++ b/scrapy/core/spidermw.py
@@ -19,7 +19,7 @@ def _isiterable(possible_iterator):
def _fname(f):
- return "%s.%s".format(
+ return "{}.{}".format(
f.__self__.__class__.__name__,
f.__func__.__name__
)
diff --git a/scrapy/utils/console.py b/scrapy/utils/console.py
index c7a2ace88..133261fd7 100644
--- a/scrapy/utils/console.py
+++ b/scrapy/utils/console.py
@@ -28,6 +28,7 @@ def _embed_ipython_shell(namespace={}, banner=''):
def _embed_bpython_shell(namespace={}, banner=''):
"""Start a bpython shell"""
import bpython
+
@wraps(_embed_bpython_shell)
def wrapper(namespace=namespace, banner=''):
bpython.embed(locals_=namespace, banner=banner)
@@ -37,6 +38,7 @@ def _embed_bpython_shell(namespace={}, banner=''):
def _embed_ptpython_shell(namespace={}, banner=''):
"""Start a ptpython shell"""
import ptpython.repl
+
@wraps(_embed_ptpython_shell)
def wrapper(namespace=namespace, banner=''):
print(banner)
diff --git a/scrapy/utils/python.py b/scrapy/utils/python.py
index 3d02d9478..9c1f3c2fe 100644
--- a/scrapy/utils/python.py
+++ b/scrapy/utils/python.py
@@ -152,6 +152,7 @@ def memoizemethod_noargs(method):
weak reference to its object
"""
cache = weakref.WeakKeyDictionary()
+
@wraps(method)
def new_method(self, *args, **kwargs):
if self not in cache: