File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3030value_errors = {C .GIT_EEXISTS , C .GIT_EINVALIDSPEC , C .GIT_EAMBIGUOUS }
3131
3232
33- def check_error (err , io = False ):
33+ def check_error (err : int , io : bool = False ) -> None :
3434 if err >= 0 :
3535 return
3636
@@ -41,7 +41,9 @@ def check_error(err, io=False):
4141 # Error message
4242 giterr = C .git_error_last ()
4343 if giterr != ffi .NULL :
44- message = ffi .string (giterr .message ).decode ('utf8' )
44+ message = ffi .string (giterr .message )
45+ if isinstance (message , bytes ):
46+ message = message .decode ('utf8' )
4547 else :
4648 message = f'err { err } (no message provided)'
4749
@@ -66,6 +68,6 @@ def check_error(err, io=False):
6668
6769
6870# Indicate that we want libgit2 to pretend a function was not set
69- class Passthrough (Exception ):
71+ class Passthrough (NotImplementedError ):
7072 def __init__ (self ):
7173 super ().__init__ ('The function asked for pass-through' )
You can’t perform that action at this time.
0 commit comments