Kiln » Dependencies » Dulwich Read More
Clone URL:  
Pushed to one repository · View In Graph Contained in master

Add function for testing whether to ignore specific error.

Changeset e15f8632f9e9

Parent 3aee61cb7dbd

by Jelmer Vernooij

Changes to one file · Browse files at e15f8632f9e9 Showing diff from parent 3aee61cb7dbd Diff from another changeset...

 
19
20
21
22
 
23
24
25
 
200
201
202
 
 
 
 
 
 
 
 
19
20
21
 
22
23
24
25
 
200
201
202
203
204
205
206
207
208
209
@@ -19,7 +19,7 @@
   """Utilities for testing git server compatibility."""   - +import errno  import os  import select  import shutil @@ -200,3 +200,10 @@
  def capabilities(cls):   return tuple(c for c in ReceivePackHandler.capabilities()   if c != 'side-band-64k') + + +def ignore_error((e_type, e_value, e_tb)): + """Check whether this error is safe to ignore.""" + return (issubclass(e_type, socket.error) and + e_value[0] in (errno.ECONNRESET, errno.EPIPE)) +