@@ -399,28 +399,25 @@ def __setstate__(self, d: Dict[str, Any]) -> None:
399
399
400
400
_USE_SHELL : bool = False
401
401
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.
405
404
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.
410
409
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.
415
414
416
- See:
415
+ See:
417
416
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
+ """
424
421
425
422
_git_exec_env_var = "GIT_PYTHON_GIT_EXECUTABLE"
426
423
_refresh_env_var = "GIT_PYTHON_REFRESH"
@@ -921,6 +918,11 @@ def __getattr__(self, name: str) -> Any:
921
918
"""
922
919
if name .startswith ("_" ):
923
920
return super ().__getattribute__ (name )
921
+
922
+ if name == "USE_SHELL" :
923
+ _warn_use_shell (False )
924
+ return self ._USE_SHELL
925
+
924
926
return lambda * args , ** kwargs : self ._call_process (name , * args , ** kwargs )
925
927
926
928
def set_persistent_git_options (self , ** kwargs : Any ) -> None :
0 commit comments