From fac56a00dbcc35183b906e2acaeb9c2efca8f83c Mon Sep 17 00:00:00 2001 From: Matthew Wardrop Date: Fri, 26 May 2017 17:25:04 -0700 Subject: [PATCH] Use get_ipython imported from IPython rather than global namespace. --- progressbar/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/progressbar/utils.py b/progressbar/utils.py index a969484a..5e2043ef 100644 --- a/progressbar/utils.py +++ b/progressbar/utils.py @@ -157,7 +157,8 @@ def get_terminal_size(): # pragma: no cover try: # Default to 79 characters for IPython notebooks - ipython = globals().get('get_ipython')() + from IPython import get_ipython + ipython = get_ipython() from ipykernel import zmqshell if isinstance(ipython, zmqshell.ZMQInteractiveShell): return 79, 24