Skip to content

Commit

Permalink
Run WindowsSelectorEventLoop event loop explicit on windows and py3. (#…
Browse files Browse the repository at this point in the history
…7940)

* Run WindowsSelectorEventLoop event loop explicit on windows and py3.
* Required from python3.8.

* Added changelog

* Update core.py

revert this

* add tests for 3.7 and 3.8

* test dredd on 3.7 and 3.8

Co-authored-by: Dario <medariox@users.noreply.github.com>
  • Loading branch information
p0psicles and medariox authored Apr 9, 2020
1 parent 9da71c9 commit 4e54342
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,25 @@ jobs:
env:
- TOXENV=py36,lint
<<: *_backend_tests
# dredd tests (py2.7) start here
- name: 'Dredd tests (py2.7)'
python: '2.7'
# backend tests (py3.7) start here
- name: 'Backend tests (py3.7)'
python: '3.7'
env:
- TOXENV=py37
<<: *_backend_tests
# backend tests (py3.8) start here
- name: 'Backend tests (py3.8)'
python: '3.8'
env:
- TOXENV=py38
<<: *_backend_tests
# dredd tests (py3.7) start here
- name: 'Dredd tests (py3.7)'
python: '3.7'
<<: *_dredd_tests
# dredd tests (py3.6) start here
- name: 'Dredd tests (py3.6)'
python: '3.6'
# dredd tests (py3.8) start here
- name: 'Dredd tests (py3.8)'
python: '3.8'
<<: *_dredd_tests

notifications:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#### Fixes
- Fixed root dirs not always shown on Home page ([#7921](https://github.com/pymedusa/Medusa/pull/7921))
- Fixed starting medusa failed running python3.8 on windows ([#7940](https://github.com/pymedusa/Medusa/pull/7940))

-----

Expand Down
5 changes: 5 additions & 0 deletions medusa/server/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@ def run(self):
# Start event loop in python3
if six.PY3:
import asyncio
import sys

# We need to set the WindowsSelectorEventLoop event loop on python 3 (3.8 and higher) running on windows
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.set_event_loop(asyncio.new_event_loop())

if self.enable_https:
Expand Down

0 comments on commit 4e54342

Please sign in to comment.