@@ -499,42 +499,6 @@ def session_check_name(session_name: str | None) -> None:
499499 raise exc .BadSessionName (reason = "contains colons" , session_name = session_name )
500500
501501
502- def handle_option_error (error : str ) -> type [exc .OptionError ]:
503- """Raise exception if error in option command found.
504-
505- In tmux 3.0, show-option and show-window-option return invalid option instead of
506- unknown option. See https://github.com/tmux/tmux/blob/3.0/cmd-show-options.c.
507-
508- In tmux >2.4, there are 3 different types of option errors:
509-
510- - unknown option
511- - invalid option
512- - ambiguous option
513-
514- In tmux <2.4, unknown option was the only option.
515-
516- All errors raised will have the base error of :exc:`exc.OptionError`. So to
517- catch any option error, use ``except exc.OptionError``.
518-
519- Parameters
520- ----------
521- error : str
522- Error response from subprocess call.
523-
524- Raises
525- ------
526- :exc:`exc.OptionError`, :exc:`exc.UnknownOption`, :exc:`exc.InvalidOption`,
527- :exc:`exc.AmbiguousOption`
528- """
529- if "unknown option" in error :
530- raise exc .UnknownOption (error )
531- if "invalid option" in error :
532- raise exc .InvalidOption (error )
533- if "ambiguous option" in error :
534- raise exc .AmbiguousOption (error )
535- raise exc .OptionError (error ) # Raise generic option error
536-
537-
538502def get_libtmux_version () -> LooseVersion :
539503 """Return libtmux version is a PEP386 compliant format.
540504
0 commit comments