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