@@ -449,30 +449,6 @@ def _validate_completion_callable(self: argparse.Action, value: Any) -> Any:
449449register_argparse_argument_parameter ("nargs_range" )
450450register_argparse_argument_parameter ("suppress_tab_hint" )
451451
452- ############################################################################################################
453- # Workaround for Python 3.15.0b1 argparse bug
454- # _ColorlessTheme.__getattr__ incorrectly returns "" for non-public attributes, which breaks
455- # protocols like copy.deepcopy().
456- ############################################################################################################
457-
458- if sys .version_info >= (3 , 15 ):
459-
460- def _ColorlessTheme_getattr ( # noqa: N802
461- _self : argparse ._ColorlessTheme , # type: ignore[name-defined]
462- name : str ,
463- ) -> Any :
464- """Patched __getattr__ that allows non-public lookups to fail correctly.
465-
466- This matches the implementation in CPython for their next release.
467- """
468- if name .startswith ("_" ):
469- raise AttributeError (name )
470- return ""
471-
472- # If the bug still exists, then install the patch.
473- if getattr (argparse ._ColorlessTheme (), "__deepcopy__" , None ) == "" : # type: ignore[attr-defined]
474- argparse ._ColorlessTheme .__getattr__ = _ColorlessTheme_getattr # type: ignore[attr-defined]
475-
476452
477453############################################################################################################
478454# Patch _ActionsContainer.add_argument to support more arguments
0 commit comments