Skip to content

Commit ba96699

Browse files
TomAugspurgerPingviinituutti
authored andcommitted
CLN: Remove ipython 2.x compat (pandas-dev#25150)
* CLN: Remove ipython 2.x compat * trivial change to trigger asv * Update v0.25.0.rst * revert whatsnew
1 parent e69ecce commit ba96699

File tree

3 files changed

+1
-55
lines changed

3 files changed

+1
-55
lines changed

asv_bench/benchmarks/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Pandas benchmarks."""

pandas/core/frame.py

-17
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import itertools
1919
import sys
2020
import warnings
21-
from distutils.version import LooseVersion
2221
from textwrap import dedent
2322

2423
import numpy as np
@@ -642,22 +641,6 @@ def _repr_html_(self):
642641
643642
Mainly for IPython notebook.
644643
"""
645-
# qtconsole doesn't report its line width, and also
646-
# behaves badly when outputting an HTML table
647-
# that doesn't fit the window, so disable it.
648-
# XXX: In IPython 3.x and above, the Qt console will not attempt to
649-
# display HTML, so this check can be removed when support for
650-
# IPython 2.x is no longer needed.
651-
try:
652-
import IPython
653-
except ImportError:
654-
pass
655-
else:
656-
if LooseVersion(IPython.__version__) < LooseVersion('3.0'):
657-
if console.in_qtconsole():
658-
# 'HTML output is disabled in QtConsole'
659-
return None
660-
661644
if self._info_repr():
662645
buf = StringIO(u(""))
663646
self.info(buf=buf)

pandas/io/formats/console.py

-38
Original file line numberDiff line numberDiff line change
@@ -108,44 +108,6 @@ def check_main():
108108
return check_main()
109109

110110

111-
def in_qtconsole():
112-
"""
113-
check if we're inside an IPython qtconsole
114-
115-
.. deprecated:: 0.14.1
116-
This is no longer needed, or working, in IPython 3 and above.
117-
"""
118-
try:
119-
ip = get_ipython() # noqa
120-
front_end = (
121-
ip.config.get('KernelApp', {}).get('parent_appname', "") or
122-
ip.config.get('IPKernelApp', {}).get('parent_appname', ""))
123-
if 'qtconsole' in front_end.lower():
124-
return True
125-
except NameError:
126-
return False
127-
return False
128-
129-
130-
def in_ipnb():
131-
"""
132-
check if we're inside an IPython Notebook
133-
134-
.. deprecated:: 0.14.1
135-
This is no longer needed, or working, in IPython 3 and above.
136-
"""
137-
try:
138-
ip = get_ipython() # noqa
139-
front_end = (
140-
ip.config.get('KernelApp', {}).get('parent_appname', "") or
141-
ip.config.get('IPKernelApp', {}).get('parent_appname', ""))
142-
if 'notebook' in front_end.lower():
143-
return True
144-
except NameError:
145-
return False
146-
return False
147-
148-
149111
def in_ipython_frontend():
150112
"""
151113
check if we're inside an an IPython zmq frontend

0 commit comments

Comments
 (0)