Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit84bf2ca

Browse files
committed
Read USE_SHELL in Git.execute without DeprecationWarning
This changes how Git.execute itself accesses the USE_SHELLattribute, so that its own read of it does not issue a warning.
1 parentc5d5b16 commit84bf2ca

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎git/cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,12 @@ def execute(
11891189

11901190
stdout_sink=PIPEifwith_stdoutelsegetattr(subprocess,"DEVNULL",None)oropen(os.devnull,"wb")
11911191
ifshellisNone:
1192-
shell=self.USE_SHELL
1192+
# Get the value of USE_SHELL with no deprecation warning. Do this without
1193+
# warnings.catch_warnings, to avoid a race condition with application code
1194+
# configuring warnings. The value could be looked up in type(self).__dict__
1195+
# or Git.__dict__, but those can break under some circumstances. This works
1196+
# the same as self.USE_SHELL in more situations; see Git.__getattribute__.
1197+
shell=super().__getattribute__("USE_SHELL")
11931198
_logger.debug(
11941199
"Popen(%s, cwd=%s, stdin=%s, shell=%s, universal_newlines=%s)",
11951200
redacted_command,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp