Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2eae445

Browse filesBrowse files
authored
MNT: be more precise in scope of exception handling
1 parent 49ded88 commit 2eae445
Copy full SHA for 2eae445

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/matplotlib/backends/backend_webagg.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_webagg.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ def random_ports(port, n):
245245

246246
@classmethod
247247
def start(cls):
248+
import asyncio
248249
try:
249-
import asyncio
250250
asyncio.get_running_loop()
251-
except:
251+
except RuntimeError:
252252
pass
253253
else:
254254
cls.started = True
@@ -294,10 +294,10 @@ def ipython_inline_display(figure):
294294
import tornado.template
295295

296296
WebAggApplication.initialize()
297+
import asyncio
297298
try:
298-
import asyncio
299299
asyncio.get_running_loop()
300-
except:
300+
except RuntimeError:
301301
if not webagg_server_thread.is_alive():
302302
webagg_server_thread.start()
303303

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.