Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit deb5364

Browse files
author
Augusto
committed
The fix_error_editor hook was deprecated in version 7.0, and no
complaints have been raised as of today: #9649
1 parent a6082c6 commit deb5364

1 file changed

Lines changed: 0 additions & 39 deletions

File tree

IPython/core/hooks.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def load_ipython_extension(ip):
3737

3838
import os
3939
import subprocess
40-
import warnings
4140
import sys
4241

4342
from .error import TryNext
@@ -82,44 +81,6 @@ def editor(self, filename, linenum=None, wait=True):
8281
if wait and proc.wait() != 0:
8382
raise TryNext()
8483

85-
import tempfile
86-
from ..utils.decorators import undoc
87-
88-
@undoc
89-
def fix_error_editor(self,filename,linenum,column,msg):
90-
"""DEPRECATED
91-
92-
Open the editor at the given filename, linenumber, column and
93-
show an error message. This is used for correcting syntax errors.
94-
The current implementation only has special support for the VIM editor,
95-
and falls back on the 'editor' hook if VIM is not used.
96-
97-
Call ip.set_hook('fix_error_editor',yourfunc) to use your own function,
98-
"""
99-
100-
warnings.warn("""
101-
`fix_error_editor` is deprecated as of IPython 6.0 and will be removed
102-
in future versions. It appears to be used only for automatically fixing syntax
103-
error that has been broken for a few years and has thus been removed. If you
104-
happened to use this function and still need it please make your voice heard on
105-
the mailing list [email protected] , or on the GitHub Issue tracker:
106-
https://github.com/ipython/ipython/issues/9649 """, UserWarning)
107-
108-
def vim_quickfix_file():
109-
t = tempfile.NamedTemporaryFile()
110-
t.write('%s:%d:%d:%s\n' % (filename,linenum,column,msg))
111-
t.flush()
112-
return t
113-
if os.path.basename(self.editor) != 'vim':
114-
self.hooks.editor(filename,linenum)
115-
return
116-
t = vim_quickfix_file()
117-
try:
118-
if os.system('vim --cmd "set errorformat=%f:%l:%c:%m" -q ' + t.name):
119-
raise TryNext()
120-
finally:
121-
t.close()
122-
12384

12485
def synchronize_with_editor(self, filename, linenum, column):
12586
pass

0 commit comments

Comments
 (0)