From ba9669981b257b18cb3ff47ae38d24ec377cd2e2 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Sat, 9 Feb 2019 17:38:55 -0600 Subject: [PATCH] CLN: Remove ipython 2.x compat (#25150) * CLN: Remove ipython 2.x compat * trivial change to trigger asv * Update v0.25.0.rst * revert whatsnew --- asv_bench/benchmarks/__init__.py | 1 + pandas/core/frame.py | 17 -------------- pandas/io/formats/console.py | 38 -------------------------------- 3 files changed, 1 insertion(+), 55 deletions(-) diff --git a/asv_bench/benchmarks/__init__.py b/asv_bench/benchmarks/__init__.py index e69de29bb2d1d6..eada147852fe17 100644 --- a/asv_bench/benchmarks/__init__.py +++ b/asv_bench/benchmarks/__init__.py @@ -0,0 +1 @@ +"""Pandas benchmarks.""" diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5ceb9db39f830b..e89aeb29f16250 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -18,7 +18,6 @@ import itertools import sys import warnings -from distutils.version import LooseVersion from textwrap import dedent import numpy as np @@ -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) diff --git a/pandas/io/formats/console.py b/pandas/io/formats/console.py index d5ef9f61bc1328..ad63b3efdd8322 100644 --- a/pandas/io/formats/console.py +++ b/pandas/io/formats/console.py @@ -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