@@ -399,28 +399,25 @@ def __setstate__(self, d: Dict[str, Any]) -> None:
399399
400400 _USE_SHELL : bool = False
401401
402- @property
403- def USE_SHELL (self ) -> bool :
404- """Deprecated. If set to ``True``, a shell will be used to execute git commands.
402+ USE_SHELL : bool
403+ """Deprecated. If set to ``True``, a shell will be used to execute git commands.
405404
406- Prior to GitPython 2.0.8, this had a narrow purpose in suppressing console
407- windows in graphical Windows applications. In 2.0.8 and higher, it provides no
408- benefit, as GitPython solves that problem more robustly and safely by using the
409- ``CREATE_NO_WINDOW`` process creation flag on Windows.
405+ Prior to GitPython 2.0.8, this had a narrow purpose in suppressing console windows
406+ in graphical Windows applications. In 2.0.8 and higher, it provides no benefit, as
407+ GitPython solves that problem more robustly and safely by using the
408+ ``CREATE_NO_WINDOW`` process creation flag on Windows.
410409
411- Code that uses ``USE_SHELL = True`` or that passes ``shell=True`` to any
412- GitPython functions should be updated to use the default value of ``False``
413- instead. ``True`` is unsafe unless the effect of shell expansions is fully
414- considered and accounted for, which is not possible under most circumstances.
410+ Code that uses ``USE_SHELL = True`` or that passes ``shell=True`` to any GitPython
411+ functions should be updated to use the default value of ``False`` instead. ``True ``
412+ is unsafe unless the effect of shell expansions is fully considered and accounted
413+ for, which is not possible under most circumstances.
415414
416- See:
415+ See:
417416
418- - :meth:`Git.execute` (on the ``shell`` parameter).
419- - https://github.com/gitpython-developers/GitPython/commit/0d9390866f9ce42870d3116094cd49e0019a970a
420- - https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
421- """
422- _warn_use_shell (False )
423- return self ._USE_SHELL
417+ - :meth:`Git.execute` (on the ``shell`` parameter).
418+ - https://github.com/gitpython-developers/GitPython/commit/0d9390866f9ce42870d3116094cd49e0019a970a
419+ - https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
420+ """
424421
425422 _git_exec_env_var = "GIT_PYTHON_GIT_EXECUTABLE"
426423 _refresh_env_var = "GIT_PYTHON_REFRESH"
@@ -921,6 +918,11 @@ def __getattr__(self, name: str) -> Any:
921918 """
922919 if name .startswith ("_" ):
923920 return super ().__getattribute__ (name )
921+
922+ if name == "USE_SHELL" :
923+ _warn_use_shell (False )
924+ return self ._USE_SHELL
925+
924926 return lambda * args , ** kwargs : self ._call_process (name , * args , ** kwargs )
925927
926928 def set_persistent_git_options (self , ** kwargs : Any ) -> None :
0 commit comments