@@ -464,42 +464,6 @@ def session_check_name(session_name: str | None) -> None:
464464 raise exc .BadSessionName (reason = "contains colons" , session_name = session_name )
465465
466466
467- def handle_option_error (error : str ) -> type [exc .OptionError ]:
468- """Raise exception if error in option command found.
469-
470- In tmux 3.0, show-option and show-window-option return invalid option instead of
471- unknown option. See https://github.com/tmux/tmux/blob/3.0/cmd-show-options.c.
472-
473- In tmux >2.4, there are 3 different types of option errors:
474-
475- - unknown option
476- - invalid option
477- - ambiguous option
478-
479- In tmux <2.4, unknown option was the only option.
480-
481- All errors raised will have the base error of :exc:`exc.OptionError`. So to
482- catch any option error, use ``except exc.OptionError``.
483-
484- Parameters
485- ----------
486- error : str
487- Error response from subprocess call.
488-
489- Raises
490- ------
491- :exc:`exc.OptionError`, :exc:`exc.UnknownOption`, :exc:`exc.InvalidOption`,
492- :exc:`exc.AmbiguousOption`
493- """
494- if "unknown option" in error :
495- raise exc .UnknownOption (error )
496- if "invalid option" in error :
497- raise exc .InvalidOption (error )
498- if "ambiguous option" in error :
499- raise exc .AmbiguousOption (error )
500- raise exc .OptionError (error ) # Raise generic option error
501-
502-
503467def get_libtmux_version () -> LooseVersion :
504468 """Return libtmux version is a PEP386 compliant format.
505469
0 commit comments