diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-07-13 15:44:43 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-07-13 15:55:40 +0300 |
commit | 585f8fd57a4ab83eca0890f5c05e959b79ef4ea4 (patch) | |
tree | 6714fb98ebef8ae413eaf223e3a7b29cf01cedc6 /contrib/python/ipython/py3/IPython | |
parent | e12a75707d4c42a0081e951c9142db0bf460d802 (diff) | |
download | ydb-585f8fd57a4ab83eca0890f5c05e959b79ef4ea4.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/python/ipython/py3/IPython')
10 files changed, 28 insertions, 11 deletions
diff --git a/contrib/python/ipython/py3/IPython/core/async_helpers.py b/contrib/python/ipython/py3/IPython/core/async_helpers.py index 0e7db0bb54d..4dfac541032 100644 --- a/contrib/python/ipython/py3/IPython/core/async_helpers.py +++ b/contrib/python/ipython/py3/IPython/core/async_helpers.py @@ -10,7 +10,6 @@ explicitly to actually raise a SyntaxError and stay as close as possible to Python semantics. """ - import ast import asyncio import inspect diff --git a/contrib/python/ipython/py3/IPython/core/interactiveshell.py b/contrib/python/ipython/py3/IPython/core/interactiveshell.py index 86eb7191e84..d05cb451f83 100644 --- a/contrib/python/ipython/py3/IPython/core/interactiveshell.py +++ b/contrib/python/ipython/py3/IPython/core/interactiveshell.py @@ -2033,7 +2033,7 @@ class InteractiveShell(SingletonConfigurable): print(self.InteractiveTB.stb2text(stb)) print("The original exception:") stb = self.InteractiveTB.structured_traceback( - (etype,value,tb), tb_offset=tb_offset + etype, value, tb, tb_offset=tb_offset ) return stb diff --git a/contrib/python/ipython/py3/IPython/core/release.py b/contrib/python/ipython/py3/IPython/core/release.py index 431ce998747..b72524d6ff8 100644 --- a/contrib/python/ipython/py3/IPython/core/release.py +++ b/contrib/python/ipython/py3/IPython/core/release.py @@ -16,7 +16,7 @@ # release. 'dev' as a _version_extra string means this is a development # version _version_major = 8 -_version_minor = 25 +_version_minor = 26 _version_patch = 0 _version_extra = ".dev" # _version_extra = "rc1" diff --git a/contrib/python/ipython/py3/IPython/lib/pretty.py b/contrib/python/ipython/py3/IPython/lib/pretty.py index 631445b24e3..8a24632d600 100644 --- a/contrib/python/ipython/py3/IPython/lib/pretty.py +++ b/contrib/python/ipython/py3/IPython/lib/pretty.py @@ -406,8 +406,16 @@ class RepresentationPrinter(PrettyPrinter): meth = cls._repr_pretty_ if callable(meth): return meth(obj, self, cycle) - if cls is not object \ - and callable(cls.__dict__.get('__repr__')): + if ( + cls is not object + # check if cls defines __repr__ + and "__repr__" in cls.__dict__ + # check if __repr__ is callable. + # Note: we need to test getattr(cls, '__repr__') + # instead of cls.__dict__['__repr__'] + # in order to work with descriptors like partialmethod, + and callable(_safe_getattr(cls, "__repr__", None)) + ): return _repr_pprint(obj, self, cycle) return _default_pprint(obj, self, cycle) diff --git a/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py b/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py index bdc783c131b..40e2c9a6699 100644 --- a/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py +++ b/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py @@ -943,6 +943,11 @@ class TerminalInteractiveShell(InteractiveShell): active_eventloop: Optional[str] = None def enable_gui(self, gui: Optional[str] = None) -> None: + if gui: + from ..core.pylabtools import _convert_gui_from_matplotlib + + gui = _convert_gui_from_matplotlib(gui) + if self.simple_prompt is True and gui is not None: print( f'Cannot install event loop hook for "{gui}" when running with `--simple-prompt`.' diff --git a/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/asyncio.py b/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/asyncio.py index d2499e11e68..8f6a7f49656 100644 --- a/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/asyncio.py +++ b/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/asyncio.py @@ -27,6 +27,7 @@ prompt_toolkit`s `patch_stdout`):: In [4]: asyncio.ensure_future(f()) """ + from prompt_toolkit import __version__ as ptk_version from IPython.core.async_helpers import get_asyncio_loop diff --git a/contrib/python/ipython/py3/IPython/testing/decorators.py b/contrib/python/ipython/py3/IPython/testing/decorators.py index af42f349d5a..97e6918e444 100644 --- a/contrib/python/ipython/py3/IPython/testing/decorators.py +++ b/contrib/python/ipython/py3/IPython/testing/decorators.py @@ -147,10 +147,13 @@ skip_osx = skipif(sys.platform == 'darwin',"This test does not run under OS X") # Decorators to skip tests if not on specific platforms. -skip_if_not_win32 = skipif(sys.platform != 'win32', - "This test only runs under Windows") -skip_if_not_linux = skipif(not sys.platform.startswith('linux'), - "This test only runs under Linux") +skip_if_not_win32 = skipif(sys.platform != "win32", "This test only runs under Windows") +skip_if_not_linux = skipif( + not sys.platform.startswith("linux"), "This test only runs under Linux" +) +skip_if_not_osx = skipif( + not sys.platform.startswith("darwin"), "This test only runs under macOS" +) _x11_skip_cond = (sys.platform not in ('darwin', 'win32') and os.environ.get('DISPLAY', '') == '') diff --git a/contrib/python/ipython/py3/IPython/utils/_process_emscripten.py b/contrib/python/ipython/py3/IPython/utils/_process_emscripten.py index 05dcdc34d5f..bfc25184623 100644 --- a/contrib/python/ipython/py3/IPython/utils/_process_emscripten.py +++ b/contrib/python/ipython/py3/IPython/utils/_process_emscripten.py @@ -3,7 +3,6 @@ This file is only meant to be imported by process.py, not by end-users. """ - from ._process_common import arg_split diff --git a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py index e2e484d4935..14569760e1d 100644 --- a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py +++ b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py @@ -1,2 +1,2 @@ # GENERATED BY setup.py -commit = "40a5a37ca" +commit = "e0c8289d9" diff --git a/contrib/python/ipython/py3/IPython/utils/io.py b/contrib/python/ipython/py3/IPython/utils/io.py index cef4319f92c..abe30730ffa 100644 --- a/contrib/python/ipython/py3/IPython/utils/io.py +++ b/contrib/python/ipython/py3/IPython/utils/io.py @@ -75,6 +75,8 @@ class Tee(object): if not self._closed: self.close() + def isatty(self): + return False def ask_yes_no(prompt, default=None, interrupt=None): """Asks a question and returns a boolean (y/n) answer. |