File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2- # -*- coding: utf-8; -*-
32
4- # Copyright (c) 2022 Oracle and/or its affiliates.
3+ # Copyright (c) 2022, 2026 Oracle and/or its affiliates.
54# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
65
76import logging
@@ -63,12 +62,14 @@ def configure_plotting():
6362
6463try :
6564 import IPython
65+
6666 shell = IPython .get_ipython ()
67- global orig_ipython_traceback
68- if shell .showtraceback != _log_traceback :
69- orig_ipython_traceback = shell .showtraceback
67+ if shell is not None :
68+ global orig_ipython_traceback
69+ if shell .showtraceback != _log_traceback :
70+ orig_ipython_traceback = shell .showtraceback
7071
71- # Override the default showtraceback behavior of ipython, to show only the error message and log the stacktrace
72- shell .showtraceback = _log_traceback
72+ # Override the default showtraceback behavior of ipython, to show only the error message and log the stacktrace
73+ shell .showtraceback = _log_traceback
7374except ModuleNotFoundError :
7475 pass
You can’t perform that action at this time.
0 commit comments