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

Define PermissionError in Python versions < 3.3#830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletionsgit/cmd.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -43,6 +43,10 @@
stream_copy,
)

try:
PermissionError
except NameError: # Python < 3.3
PermissionError = OSError

execute_kwargs = {'istream', 'with_extended_output',
'with_exceptions', 'as_process', 'stdout_as_string',
Expand DownExpand Up@@ -211,22 +215,15 @@ def refresh(cls, path=None):

# test if the new git executable path is valid

if sys.version_info < (3,):
# - a GitCommandNotFound error is spawned by ourselves
# - a OSError is spawned if the git executable provided
# cannot be executed for whatever reason
exceptions = (GitCommandNotFound, OSError)
else:
# - a GitCommandNotFound error is spawned by ourselves
# - a PermissionError is spawned if the git executable provided
# cannot be executed for whatever reason
exceptions = (GitCommandNotFound, PermissionError)

# - a GitCommandNotFound error is spawned by ourselves
# - a PermissionError is spawned if the git executable provided
# cannot be executed for whatever reason

has_git = False
try:
cls().version()
has_git = True
exceptexceptions:
except(GitCommandNotFound, PermissionError):
pass

# warn or raise exception if test failed
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp