question about bzrlib/changeset.py

Alexander Belchenko bialix at ukr.net
Tue Sep 6 13:06:49 BST 2005


2 Aaron Bentley and other bzr developers:

I discover in function dir_create(filename, conflict_handler, reverse) 
from bzrlib/changeset.py this chunk of code:

     if not reverse:
	...
     else:
         try:
             os.rmdir(filename)
         except OSError, e:
             if e.errno != 39:
                 raise
             if conflict_handler.rmdir_non_empty(filename) == "skip":
                 return
             os.rmdir(filename)

I have two questions.
First, I think that comparing with constant 39 is not portable solution. 
May be it need to be:

	if e.errno != errno.ENOTEMPTY:

Second, I not competely understand why for second call to os.rmdir (last 
line in the above fragment) if first attempt raise exception?

--
Alexander





More information about the bazaar mailing list