@@ -423,30 +423,6 @@ def _validate_completion_callable(self: argparse.Action, value: Any) -> Any:
423423register_argparse_argument_parameter ("nargs_range" )
424424register_argparse_argument_parameter ("suppress_tab_hint" )
425425
426- ############################################################################################################
427- # Workaround for Python 3.15.0b1 argparse bug
428- # _ColorlessTheme.__getattr__ incorrectly returns "" for non-public attributes, which breaks
429- # protocols like copy.deepcopy().
430- ############################################################################################################
431-
432- if sys .version_info >= (3 , 15 ):
433-
434- def _ColorlessTheme_getattr ( # noqa: N802
435- _self : argparse ._ColorlessTheme , # type: ignore[name-defined]
436- name : str ,
437- ) -> Any :
438- """Patched __getattr__ that allows non-public lookups to fail correctly.
439-
440- This matches the implementation in CPython for their next release.
441- """
442- if name .startswith ("_" ):
443- raise AttributeError (name )
444- return ""
445-
446- # If the bug still exists, then install the patch.
447- if getattr (argparse ._ColorlessTheme (), "__deepcopy__" , None ) == "" : # type: ignore[attr-defined]
448- argparse ._ColorlessTheme .__getattr__ = _ColorlessTheme_getattr # type: ignore[attr-defined]
449-
450426
451427############################################################################################################
452428# Patch _ActionsContainer.add_argument to support more arguments
0 commit comments