Skip to content

Commit 67fda44

Browse files
committed
PRF: only try to use IPython if already imported
1 parent e2cf264 commit 67fda44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/matplotlib/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1591,7 +1591,9 @@ def param(func):
15911591
python_has_signature = major >= 3 and minor1 >= 3
15921592
python_has_wrapped = major >= 3 and minor1 >= 2
15931593

1594-
if not python_has_signature:
1594+
# if in a legacy version of python and IPython is already imported
1595+
# try to use their back-ported signature
1596+
if not python_has_signature and 'IPython' in sys.modules:
15951597
try:
15961598
import IPython.utils.signatures
15971599
signature = IPython.utils.signatures.signature

0 commit comments

Comments
 (0)