@@ -446,43 +446,6 @@ def session_check_name(session_name: t.Optional[str]) -> None:
446446 raise exc .BadSessionName (reason = "contains colons" , session_name = session_name )
447447
448448
449- def handle_option_error (error : str ) -> t .Type [exc .OptionError ]:
450- """Raise exception if error in option command found.
451-
452- In tmux 3.0, show-option and show-window-option return invalid option instead of
453- unknown option. See https://github.com/tmux/tmux/blob/3.0/cmd-show-options.c.
454-
455- In tmux >2.4, there are 3 different types of option errors:
456-
457- - unknown option
458- - invalid option
459- - ambiguous option
460-
461- In tmux <2.4, unknown option was the only option.
462-
463- All errors raised will have the base error of :exc:`exc.OptionError`. So to
464- catch any option error, use ``except exc.OptionError``.
465-
466- Parameters
467- ----------
468- error : str
469- Error response from subprocess call.
470-
471- Raises
472- ------
473- :exc:`exc.OptionError`, :exc:`exc.UnknownOption`, :exc:`exc.InvalidOption`,
474- :exc:`exc.AmbiguousOption`
475- """
476- if "unknown option" in error :
477- raise exc .UnknownOption (error )
478- elif "invalid option" in error :
479- raise exc .InvalidOption (error )
480- elif "ambiguous option" in error :
481- raise exc .AmbiguousOption (error )
482- else :
483- raise exc .OptionError (error ) # Raise generic option error
484-
485-
486449def get_libtmux_version () -> LooseVersion :
487450 """Return libtmux version is a PEP386 compliant format.
488451
0 commit comments