Skip to content

Commit

Permalink
Fix IPython DeprecationWarning
Browse files Browse the repository at this point in the history
ptipython raises the following error since IPython 7:
>>> IPython.core.inputsplitter is deprecated since IPython 7 in favor of `IPython.core.inputtransformer2`
  • Loading branch information
gpotter2 authored and jonathanslenders committed Nov 3, 2023
1 parent 9ea3238 commit 48c7b38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ptpython/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from warnings import warn

from IPython import utils as ipy_utils
from IPython.core.inputsplitter import IPythonInputSplitter
from IPython.core.inputtransformer2 import TransformerManager
from IPython.terminal.embed import InteractiveShellEmbed as _InteractiveShellEmbed
from IPython.terminal.ipapp import load_default_config
from prompt_toolkit.completion import (
Expand Down Expand Up @@ -66,7 +66,7 @@ def out_prompt(self) -> AnyFormattedText:
class IPythonValidator(PythonValidator):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.isp = IPythonInputSplitter()
self.isp = TransformerManager()

def validate(self, document: Document) -> None:
document = Document(text=self.isp.transform_cell(document.text))
Expand Down

0 comments on commit 48c7b38

Please sign in to comment.