From 3fd7c98d2ba394587409aa1d0ff9c447f75402ce Mon Sep 17 00:00:00 2001 From: Alexander Kukushkin Date: Tue, 2 Apr 2024 14:48:58 +0200 Subject: [PATCH] Compatibility with ydiff>=1.3 (#3042) PatchStream class was removed as it was effectively doing nothing useful. --- patroni/ctl.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patroni/ctl.py b/patroni/ctl.py index 87204a644..4e05ab8d5 100644 --- a/patroni/ctl.py +++ b/patroni/ctl.py @@ -41,8 +41,12 @@ from psycopg import Cursor from psycopg2 import cursor -try: - from ydiff import markup_to_pager, PatchStream # pyright: ignore [reportMissingModuleSource] +try: # pragma: no cover + from ydiff import markup_to_pager # pyright: ignore [reportMissingModuleSource] + try: + from ydiff import PatchStream # pyright: ignore [reportMissingModuleSource] + except ImportError: + PatchStream = iter except ImportError: # pragma: no cover from cdiff import markup_to_pager, PatchStream # pyright: ignore [reportMissingModuleSource]