Skip to content

Commit c29a1b9

Browse files
committed
Make warning message a bit nicer in logs
1 parent c9890d5 commit c29a1b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scrapy/core/downloader/handlers/http11.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def __init__(self, settings):
4242
except TypeError:
4343
# use context factory defaults
4444
self._contextFactory = self._contextFactoryClass()
45-
warnings.warn("""
45+
msg = """
4646
You are using a context factory class that does not accept the `method` argument
4747
(type OpenSSL.SSL method, e.g. OpenSSL.SSL.SSLv23_METHOD).
48-
Please upgrade your context factory class to handle or ignore it.""")
48+
Please upgrade your context factory class to handle or ignore it."""
49+
warnings.warn(msg)
4950
self._default_maxsize = settings.getint('DOWNLOAD_MAXSIZE')
5051
self._default_warnsize = settings.getint('DOWNLOAD_WARNSIZE')
5152
self._disconnect_timeout = 1

0 commit comments

Comments
 (0)