Skip to content

Commit

Permalink
Fixes add_reader NotImplementedError on Python 3.8 + Windows.
Browse files Browse the repository at this point in the history
`asyncio`'s default event loop is changed in Python3.8, causing Tornado to break on Windows.

The fix is simply to ensure the old event loop is kept, when ran on Python >= 3.8, and on Windows.

More info can be found here:
* tornadoweb/tornado#2608
* lepture/python-livereload#209
  • Loading branch information
mcteo committed Oct 17, 2020
1 parent ea3edaa commit 054a42f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions livereload/server.py
Expand Up @@ -22,6 +22,10 @@
from .watcher import get_watcher_class
from six import string_types, PY3

import asyncio, sys
if sys.version_info >= (3, 8) and sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

logger = logging.getLogger('livereload')


Expand Down

0 comments on commit 054a42f

Please sign in to comment.