Skip to content

Commit

Permalink
CLN: Remove ipython 2.x compat (pandas-dev#25150)
Browse files Browse the repository at this point in the history
* CLN: Remove ipython 2.x compat

* trivial change to trigger asv

* Update v0.25.0.rst

* revert whatsnew
  • Loading branch information
TomAugspurger authored and Pingviinituutti committed Feb 28, 2019
1 parent e69ecce commit ba96699
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 55 deletions.
1 change: 1 addition & 0 deletions asv_bench/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Pandas benchmarks."""
17 changes: 0 additions & 17 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import itertools
import sys
import warnings
from distutils.version import LooseVersion
from textwrap import dedent

import numpy as np
Expand Down Expand Up @@ -642,22 +641,6 @@ def _repr_html_(self):
Mainly for IPython notebook.
"""
# qtconsole doesn't report its line width, and also
# behaves badly when outputting an HTML table
# that doesn't fit the window, so disable it.
# XXX: In IPython 3.x and above, the Qt console will not attempt to
# display HTML, so this check can be removed when support for
# IPython 2.x is no longer needed.
try:
import IPython
except ImportError:
pass
else:
if LooseVersion(IPython.__version__) < LooseVersion('3.0'):
if console.in_qtconsole():
# 'HTML output is disabled in QtConsole'
return None

if self._info_repr():
buf = StringIO(u(""))
self.info(buf=buf)
Expand Down
38 changes: 0 additions & 38 deletions pandas/io/formats/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,44 +108,6 @@ def check_main():
return check_main()


def in_qtconsole():
"""
check if we're inside an IPython qtconsole
.. deprecated:: 0.14.1
This is no longer needed, or working, in IPython 3 and above.
"""
try:
ip = get_ipython() # noqa
front_end = (
ip.config.get('KernelApp', {}).get('parent_appname', "") or
ip.config.get('IPKernelApp', {}).get('parent_appname', ""))
if 'qtconsole' in front_end.lower():
return True
except NameError:
return False
return False


def in_ipnb():
"""
check if we're inside an IPython Notebook
.. deprecated:: 0.14.1
This is no longer needed, or working, in IPython 3 and above.
"""
try:
ip = get_ipython() # noqa
front_end = (
ip.config.get('KernelApp', {}).get('parent_appname', "") or
ip.config.get('IPKernelApp', {}).get('parent_appname', ""))
if 'notebook' in front_end.lower():
return True
except NameError:
return False
return False


def in_ipython_frontend():
"""
check if we're inside an an IPython zmq frontend
Expand Down

0 comments on commit ba96699

Please sign in to comment.