Skip to content

Commit 1972603

Browse files
author
Kevin D Smith
committed
Remove dependency on in_qtconsole for IPython >= 3
1 parent 6ff65bc commit 1972603

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

swat/cas/results.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import re
2929
import six
3030
import pandas as pd
31-
import pandas.core.common as pdcom
3231
from ..dataframe import SASDataFrame, concat
3332
from ..notebook.zeppelin import show as z_show
3433
from ..utils.compat import OrderedDict
@@ -88,8 +87,17 @@ def _repr_html_(self):
8887
HTML representation of CASResults object
8988
9089
'''
91-
if pdcom.in_qtconsole():
92-
return None
90+
try:
91+
import IPython
92+
from pandas.io.formats import console
93+
from distutils.version import LooseVersion
94+
except ImportError:
95+
pass
96+
else:
97+
if LooseVersion(IPython.__version__) < LooseVersion('3.0'):
98+
if console.in_qtconsole():
99+
# 'HTML output is disabled in QtConsole'
100+
return None
93101

94102
if not pd.get_option('display.notebook.repr_html'):
95103
return None

0 commit comments

Comments
 (0)