patch: use st_mode

Robey Pointer robey at lag.net
Tue Oct 18 10:36:19 BST 2005


Indexing the results of os.stat() as if it was a tuple is archaic;  
this patch changes to using the named field "st_mode" instead.

(The reason I'm submitting it is that the "stat" object will usually  
come from a transport, and not all transports will implement the  
tuple duality.)

robey


=== modified file 'bzrlib/store/__init__.py'
--- bzrlib/store/__init__.py
+++ bzrlib/store/__init__.py
@@ -222,7 +222,7 @@
          while queue:
              relpath = queue.pop(0)
              st = transport.stat(relpath)
-            if S_ISDIR(st[ST_MODE]):
+            if S_ISDIR(st.st_mode):
                  for i, basename in enumerate(transport.list_dir 
(relpath)):
                      queue.insert(i, relpath+'/'+basename)
              else:






More information about the bazaar mailing list