mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9957 from tk0miya/refactor_DeprecationWarnings
Reduce DeprecationWarnings
This commit is contained in:
commit
3626c75de0
@ -30,10 +30,10 @@ def test_theme_api(app, status, warning):
|
|||||||
themes.append('alabaster')
|
themes.append('alabaster')
|
||||||
|
|
||||||
# test Theme class API
|
# test Theme class API
|
||||||
assert set(app.html_themes.keys()) == set(themes)
|
assert set(app.registry.html_themes.keys()) == set(themes)
|
||||||
assert app.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
|
assert app.registry.html_themes['test-theme'] == app.srcdir / 'test_theme' / 'test-theme'
|
||||||
assert app.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
|
assert app.registry.html_themes['ziptheme'] == app.srcdir / 'ziptheme.zip'
|
||||||
assert app.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'
|
assert app.registry.html_themes['staticfiles'] == app.srcdir / 'test_theme' / 'staticfiles'
|
||||||
|
|
||||||
# test Theme instance API
|
# test Theme instance API
|
||||||
theme = app.builder.theme
|
theme = app.builder.theme
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import contextlib
|
import contextlib
|
||||||
import http.server
|
import http.server
|
||||||
import pathlib
|
import pathlib
|
||||||
import ssl
|
|
||||||
import threading
|
import threading
|
||||||
|
from ssl import PROTOCOL_TLS_SERVER, SSLContext
|
||||||
|
|
||||||
# Generated with:
|
# Generated with:
|
||||||
# $ openssl req -new -x509 -days 3650 -nodes -out cert.pem \
|
# $ openssl req -new -x509 -days 3650 -nodes -out cert.pem \
|
||||||
@ -27,11 +27,9 @@ class HttpServerThread(threading.Thread):
|
|||||||
class HttpsServerThread(HttpServerThread):
|
class HttpsServerThread(HttpServerThread):
|
||||||
def __init__(self, handler, *args, **kwargs):
|
def __init__(self, handler, *args, **kwargs):
|
||||||
super().__init__(handler, *args, **kwargs)
|
super().__init__(handler, *args, **kwargs)
|
||||||
self.server.socket = ssl.wrap_socket(
|
sslcontext = SSLContext(PROTOCOL_TLS_SERVER)
|
||||||
self.server.socket,
|
sslcontext.load_cert_chain(CERT_FILE)
|
||||||
certfile=CERT_FILE,
|
self.server.socket = sslcontext.wrap_socket(self.server.socket, server_side=True)
|
||||||
server_side=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def create_server(thread_class):
|
def create_server(thread_class):
|
||||||
|
Loading…
Reference in New Issue
Block a user