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

In threaded programs, more than one thread can try to add the same object at
the same time and this can cause os.mkdir to fail.

Changeset b4a7c9ee386d

Parent 8883a573c252

committed by Jelmer Vernooij

authored by Bruce Duncan

Changes to one file · Browse files at b4a7c9ee386d Showing diff from parent 8883a573c252 Diff from another changeset...

 
470
471
472
473
 
474
 
 
 
475
476
477
 
470
471
472
 
473
474
475
476
477
478
479
480
@@ -470,8 +470,11 @@
  :param obj: Object to add   """   dir = os.path.join(self.path, obj.id[:2]) - if not os.path.isdir(dir): + try:   os.mkdir(dir) + except OSError, e: + if e.errno != errno.EEXIST: + raise   path = os.path.join(dir, obj.id[2:])   if os.path.exists(path):   return # Already there, no need to write again