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

Commit2a0305b

Browse files
committed
Name top-level exceptions as private variables
`exc` is private to the module. Naming it `_exc` eliminates a collisionwith the `exc` submodule (one which would not be observable at runtimedue to the import failing, but which confuses linters).
1 parente3bc5d1 commit2a0305b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎git/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def _init_externals() -> None:
5656
Actor,
5757
rmtree,
5858
)
59-
exceptGitErrorasexc:
60-
raiseImportError("%s: %s"% (exc.__class__.__name__,exc))fromexc
59+
exceptGitErroras_exc:
60+
raiseImportError("%s: %s"% (_exc.__class__.__name__,_exc))from_exc
6161

6262
# } END imports
6363

@@ -87,6 +87,6 @@ def refresh(path: Optional[PathLike] = None) -> None:
8787
#################
8888
try:
8989
refresh()
90-
exceptExceptionasexc:
91-
raiseImportError("Failed to initialize: {0}".format(exc))fromexc
90+
exceptExceptionas_exc:
91+
raiseImportError("Failed to initialize: {0}".format(_exc))from_exc
9292
#################

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp