File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from __future__ import print_function
22
3+ import warnings
34import sys
45
56
@@ -146,8 +147,24 @@ def ipython_options(**kwargs):
146147 return dict (user_ns = user_ns , config = c )
147148
148149
150+ segfault_warning = """\
151+ Segmentation fault warning.
152+
153+ You are using IPython version {IPython.__version__} which is known to
154+ cause segmentation fault with tab completion. For segfault-free
155+ IPython, upgrade to version 7 or above (which may still be in
156+ development stage depending on the time you read this message).
157+ """
158+
159+ segfault_warned = False
160+
161+
149162@print_instruction_on_import_error
150163def customized_ipython (** kwargs ):
164+ global segfault_warned
151165 import IPython
152166 print ()
167+ if int (IPython .__version__ .split ('.' , 1 )[0 ]) < 7 and not segfault_warned :
168+ warnings .warn (segfault_warning .format (** vars ()))
169+ segfault_warned = True
153170 IPython .start_ipython (** ipython_options (** kwargs ))
You can’t perform that action at this time.
0 commit comments