File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 4343    stream_copy ,
4444)
4545
46+ try :
47+     PermissionError 
48+ except  NameError :  # Python < 3.3 
49+     PermissionError  =  OSError 
4650
4751execute_kwargs  =  {'istream' , 'with_extended_output' ,
4852                  'with_exceptions' , 'as_process' , 'stdout_as_string' ,
@@ -211,22 +215,14 @@ def refresh(cls, path=None):
211215
212216        # test if the new git executable path is valid 
213217
214-         if  sys .version_info  <  (3 ,):
215-             # - a GitCommandNotFound error is spawned by ourselves 
216-             # - a OSError is spawned if the git executable provided 
217-             #   cannot be executed for whatever reason 
218-             exceptions  =  (GitCommandNotFound , OSError )
219-         else :
220-             # - a GitCommandNotFound error is spawned by ourselves 
221-             # - a PermissionError is spawned if the git executable provided 
222-             #   cannot be executed for whatever reason 
223-             exceptions  =  (GitCommandNotFound , PermissionError )
224- 
218+         # - a GitCommandNotFound error is spawned by ourselves 
219+         # - a PermissionError is raised if the git executable provided 
220+         #   cannot be executed for whatever reason 
225221        has_git  =  False 
226222        try :
227223            cls ().version ()
228224            has_git  =  True 
229-         except  exceptions :
225+         except  ( GitCommandNotFound ,  PermissionError ) :
230226            pass 
231227
232228        # warn or raise exception if test failed 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments