Skip to content

Commit 6ab3cfc

Browse files
committed
Move requests_unixsocket import outside of fetch_url()
1 parent 09ba565 commit 6ab3cfc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

notebook/tests/launchnotebook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
from unittest.mock import patch
1717

1818
import requests
19+
if os.name != 'nt':
20+
import requests_unixsocket
1921
from tornado.ioloop import IOLoop
2022
import zmq
2123

@@ -230,9 +232,6 @@ def base_url(cls):
230232

231233
@staticmethod
232234
def fetch_url(url):
233-
# Lazily import so it is not required at the module level
234-
if os.name != 'nt':
235-
import requests_unixsocket
236235
with requests_unixsocket.monkeypatch():
237236
return requests.get(url)
238237

0 commit comments

Comments
 (0)