@@ -352,7 +352,9 @@ def write(self, text: str) -> int:
352352 return super ().write (text )
353353
354354
355- def _pager_contextmanager (color : t .Optional [bool ] = None ) -> t .ContextManager [t .Tuple [t .BinaryIO , str , bool ]]:
355+ def _pager_contextmanager (
356+ color : t .Optional [bool ] = None ,
357+ ) -> t .ContextManager [t .Tuple [t .BinaryIO , str , bool ]]:
356358 """Decide what method to use for paging through text."""
357359 stdout = _default_text_stdout ()
358360 if not isatty (sys .stdin ) or not isatty (stdout ):
@@ -398,7 +400,9 @@ def get_pager_file(color: t.Optional[bool] = None) -> t.Generator[t.IO, None, No
398400
399401
400402@contextlib .contextmanager
401- def _pipepager (cmd : str , color : t .Optional [bool ]) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
403+ def _pipepager (
404+ cmd : str , color : t .Optional [bool ]
405+ ) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
402406 """Page through text by feeding it to another program. Invoking a
403407 pager through this might support colors.
404408 """
@@ -416,7 +420,7 @@ def _pipepager(cmd: str, color: t.Optional[bool]) -> t.Generator[t.Tuple[t.Binar
416420 color = True
417421 elif "r" in less_flags or "R" in less_flags :
418422 color = True
419-
423+
420424 if color is None :
421425 color = False
422426
@@ -447,7 +451,9 @@ def _pipepager(cmd: str, color: t.Optional[bool]) -> t.Generator[t.Tuple[t.Binar
447451
448452
449453@contextlib .contextmanager
450- def _tempfilepager (cmd : str , color : t .Optional [bool ]= None ) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
454+ def _tempfilepager (
455+ cmd : str , color : t .Optional [bool ] = None
456+ ) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
451457 """Page through text by invoking a program on a temporary file."""
452458 import tempfile
453459
@@ -459,7 +465,9 @@ def _tempfilepager(cmd: str, color: t.Optional[bool]=None) -> t.Generator[t.Tupl
459465
460466
461467@contextlib .contextmanager
462- def _nullpager (stream : t .TextIO , color : t .Optional [bool ]= None ) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
468+ def _nullpager (
469+ stream : t .TextIO , color : t .Optional [bool ] = None
470+ ) -> t .Generator [t .Tuple [t .BinaryIO , str , bool ], None , None ]:
463471 """Simply print unformatted text. This is the ultimate fallback."""
464472 encoding = get_best_encoding (stream )
465473 yield stream , encoding , color
0 commit comments