Skip to content

Commit

Permalink
Add simple check so it is not set inside a jupyter notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jun 24, 2024
1 parent f64bfac commit 64365fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyviz_comms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def _jupyter_labextension_paths():
}]

# Setting this so we can check the launched jupyter has pyviz_comms installed
os.environ['_PYVIZ_COMMS_INSTALLED'] = '1'
if not sys.argv[0].endswith('ipykernel_launcher.py'):
os.environ['_PYVIZ_COMMS_INSTALLED'] = '1'

# Required only to monkeypatch get_ipython in the test suite
try:
Expand Down Expand Up @@ -614,7 +615,7 @@ class JupyterCommManager(CommManager):
}
return messages.next().then(processIteratorResult);
}
})
})
var sendClosure = (data, metadata, buffers, disposeOnDone) => {
return comm_promise.then((comm) => {
comm.send(data, metadata, buffers, disposeOnDone);
Expand Down

0 comments on commit 64365fb

Please sign in to comment.