Skip to content

Commit

Permalink
Fix ipython detection (#1844)
Browse files Browse the repository at this point in the history
* Fix ipython detection
  • Loading branch information
ivirshup committed May 17, 2021
1 parent ce46baa commit bcfa925
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/release-notes/1.8.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.. rubric:: Bug fixes

- Fix :func:`scanpy.pl.paga_path` `TypeError` with recent versions of anndata :pr:`1047` :smaller:`P Angerer`
- Fix detection of whether IPython is running :pr:`1844` :smaller:`I Virshup`

.. rubric:: Deprecations

Expand Down
5 changes: 3 additions & 2 deletions scanpy/_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,9 @@ def set_figure_params(
@staticmethod
def _is_run_from_ipython():
"""Determines whether we're currently in IPython."""
# https://stackoverflow.com/questions/40638507/testing-for-presence-of-ipython
return hasattr(__builtins__, "__IPYTHON__")
import builtins

return getattr(builtins, "__IPYTHON__", False)

def __str__(self) -> str:
return '\n'.join(
Expand Down

0 comments on commit bcfa925

Please sign in to comment.