mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #26420 from terminalmage/issue26245-2015.5
Only use pygit2.errors if it exists (2015.5 branch)
This commit is contained in:
commit
09e96dce39
1 changed files with 5 additions and 1 deletions
|
@ -115,6 +115,10 @@ except ImportError:
|
|||
try:
|
||||
import pygit2
|
||||
HAS_PYGIT2 = True
|
||||
try:
|
||||
GitError = pygit2.errors.GitError
|
||||
except AttributeError:
|
||||
GitError = Exception
|
||||
except ImportError:
|
||||
HAS_PYGIT2 = False
|
||||
|
||||
|
@ -1159,7 +1163,7 @@ def update():
|
|||
pass
|
||||
try:
|
||||
fetch = origin.fetch()
|
||||
except pygit2.errors.GitError as exc:
|
||||
except GitError as exc:
|
||||
# Using exc.__str__() here to avoid deprecation warning
|
||||
# when referencing exc.message
|
||||
if 'unsupported url protocol' in exc.__str__().lower() \
|
||||
|
|
Loading…
Add table
Reference in a new issue