File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,4 @@ Miscellaneous improvements
38
38
Fixes
39
39
^^^^^
40
40
41
- * fixed something (closes :editor_issue:`1 `).
41
+ * workaround incompatibility with Python3.8 on Windows (closes :editor_issue:`208 `).
Original file line number Diff line number Diff line change 1
1
import os
2
2
import re
3
+ import sys
4
+
5
+ # Python3.8 switched from a Selector to a Proactor based event loop for asyncio but they do not offer the same
6
+ # features, which breaks Tornado and all projects depending on it, including Jupyter consoles
7
+ # refs: https://github.com/larray-project/larray-editor/issues/208
8
+ if sys .platform .startswith ("win" ) and sys .version_info >= (3 , 8 ):
9
+ import asyncio
10
+
11
+ try :
12
+ from asyncio import WindowsProactorEventLoopPolicy , WindowsSelectorEventLoopPolicy
13
+ except ImportError :
14
+ # not affected
15
+ pass
16
+ else :
17
+ if type (asyncio .get_event_loop_policy ()) is WindowsProactorEventLoopPolicy :
18
+ asyncio .set_event_loop_policy (WindowsSelectorEventLoopPolicy ())
3
19
4
20
import matplotlib
5
21
import matplotlib .axes
You can’t perform that action at this time.
0 commit comments