Fix `astroquery.utils.system_tools.in_ipynb()`
@@ -40,21 +40,9 @@ def gunzip(filename):
else:
return filename
+
# If there is an update issue of astropy#2793 that got merged, this should
# be replaced with it.
-
def in_ipynb():
- try:
- cfg = get_ipython().config
- app = cfg['IPKernelApp']
- # ipython 1.0 console has no 'parent_appname',
- # but ipynb does
- if ('parent_appname' in app and
- app['parent_appname'] == 'ipython-notebook'):
- return True
- else:
- return False
- except NameError:
- # NameError will occur if this is called from python (not ipython)
- return False
+ return 'JPY_PARENT_PID' in os.environ
