From 00a5b85803e48a9d4683a7b80362483ebaa7df72 Mon Sep 17 00:00:00 2001 From: Maxime Liquet <35924738+maximlt@users.noreply.github.com> Date: Mon, 24 Jul 2023 10:53:34 +0200 Subject: [PATCH] only set pager in an ipython context (#774) --- param/parameterized.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/param/parameterized.py b/param/parameterized.py index 6d868396f..45ddce74d 100644 --- a/param/parameterized.py +++ b/param/parameterized.py @@ -43,11 +43,16 @@ ) try: - # In case the optional ipython module is unavailable - from .ipython import ParamPager - param_pager = ParamPager(metaclass=True) # Generates param description -except: + get_ipython() +except NameError: param_pager = None +else: + # In case the optional ipython module is unavailable + try: + from .ipython import ParamPager + param_pager = ParamPager(metaclass=True) # Generates param description + except: + param_pager = None from inspect import getfullargspec