Skip to content

Commit

Permalink
Move requests_unixsocket import outside of fetch_url()
Browse files Browse the repository at this point in the history
  • Loading branch information
hrnciar committed Sep 24, 2020
1 parent 09ba565 commit 6ab3cfc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions notebook/tests/launchnotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from unittest.mock import patch

import requests
if os.name != 'nt':
import requests_unixsocket
from tornado.ioloop import IOLoop
import zmq

Expand Down Expand Up @@ -230,9 +232,6 @@ def base_url(cls):

@staticmethod
def fetch_url(url):
# Lazily import so it is not required at the module level
if os.name != 'nt':
import requests_unixsocket
with requests_unixsocket.monkeypatch():
return requests.get(url)

Expand Down

0 comments on commit 6ab3cfc

Please sign in to comment.