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

Commit0e311bf

Browse files
committed
Suppress type errors in restore_use_shell_state _USE_SHELL branches
These conditional branches are kept so alternative implementationscan be examined, including if they need to be investigated tosatisfy some future requirement. But to be unittest.mock.patchpatchable, the approaches that would have a _USE_SHELL backingattribute would be difficult to implement in a straightforward way,which seems not to be needed or justified at this time.Since that is not anticipated (except as an intermediate step indevelopment), these suppressions make sense, and they will also bereported by mypy if the implementation changes to benefit from them(so long as it is configured with warn_unused_ignores set to true).
1 parent4037108 commit0e311bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎test/deprecation/test_cmd_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def restore_use_shell_state() -> Generator[None, None, None]:
111111

112112
# Try to save the original private state.
113113
try:
114-
old_private_value=Git._USE_SHELL
114+
old_private_value=Git._USE_SHELL# type: ignore[attr-defined]
115115
exceptAttributeError:
116116
separate_backing_attribute=False
117117
try:
@@ -139,7 +139,7 @@ def restore_use_shell_state() -> Generator[None, None, None]:
139139
finally:
140140
# Try to restore the original private state.
141141
ifseparate_backing_attribute:
142-
Git._USE_SHELL=old_private_value
142+
Git._USE_SHELL=old_private_value# type: ignore[attr-defined]
143143
elifold_private_valueisnotno_value:
144144
type.__setattr__(Git,"USE_SHELL",old_private_value)
145145

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp