diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00bac0b..3f61b80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 23.3.0 hooks: - id: black language_version: python3 diff --git a/daphne/server.py b/daphne/server.py index 8da4a61..a6d3819 100755 --- a/daphne/server.py +++ b/daphne/server.py @@ -21,6 +21,7 @@ if current_reactor is not None: + "you can fix this warning by importing daphne.server early in your codebase or " + "finding the package that imports Twisted and importing it later on.", UserWarning, + stacklevel=2, ) del sys.modules["twisted.internet.reactor"] asyncioreactor.install(twisted_loop)