aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/ipython/py2/IPython/terminal/ptutils.py
diff options
context:
space:
mode:
authorsmosker <smosker@yandex-team.ru>2022-02-10 16:48:21 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:21 +0300
commitdd14d17a747a9c259858faf2fcc3ea6b92df4e15 (patch)
treef332cd81782832c17c48d8c3b4511924cd9e47fd /contrib/python/ipython/py2/IPython/terminal/ptutils.py
parentb637e2fa3213638fbabe52c15dad14c8237945ac (diff)
downloadydb-dd14d17a747a9c259858faf2fcc3ea6b92df4e15.tar.gz
Restoring authorship annotation for <smosker@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/ipython/py2/IPython/terminal/ptutils.py')
-rw-r--r--contrib/python/ipython/py2/IPython/terminal/ptutils.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/python/ipython/py2/IPython/terminal/ptutils.py b/contrib/python/ipython/py2/IPython/terminal/ptutils.py
index c9ff705642..03e33155b1 100644
--- a/contrib/python/ipython/py2/IPython/terminal/ptutils.py
+++ b/contrib/python/ipython/py2/IPython/terminal/ptutils.py
@@ -22,14 +22,14 @@ import pygments.lexers as pygments_lexers
class IPythonPTCompleter(Completer):
"""Adaptor to provide IPython completions to prompt_toolkit"""
- def __init__(self, ipy_completer=None, shell=None, patch_stdout=None):
+ def __init__(self, ipy_completer=None, shell=None, patch_stdout=None):
if shell is None and ipy_completer is None:
raise TypeError("Please pass shell=an InteractiveShell instance.")
self._ipy_completer = ipy_completer
self.shell = shell
- if patch_stdout is None:
- raise TypeError("Please pass patch_stdout")
- self.patch_stdout = patch_stdout
+ if patch_stdout is None:
+ raise TypeError("Please pass patch_stdout")
+ self.patch_stdout = patch_stdout
@property
def ipy_completer(self):
@@ -42,14 +42,14 @@ class IPythonPTCompleter(Completer):
if not document.current_line.strip():
return
- # Some bits of our completion system may print stuff (e.g. if a module
- # is imported). This context manager ensures that doesn't interfere with
- # the prompt.
- with self.patch_stdout():
- used, matches = self.ipy_completer.complete(
- line_buffer=document.current_line,
- cursor_pos=document.cursor_position_col
- )
+ # Some bits of our completion system may print stuff (e.g. if a module
+ # is imported). This context manager ensures that doesn't interfere with
+ # the prompt.
+ with self.patch_stdout():
+ used, matches = self.ipy_completer.complete(
+ line_buffer=document.current_line,
+ cursor_pos=document.cursor_position_col
+ )
start_pos = -len(used)
for m in matches:
if not m: