[PATCH 3/4] recursive_dirlist: always return to startdir; don't suppress errors

0 views
Skip to first unread message

Rob Browning

unread,
Mar 6, 2026, 6:13:47 PM (8 days ago) Mar 6
to bup-...@googlegroups.com
This assumes that it's not OK for the top level to disappear or become
unreadable. Once we add the changes that drop the need to chdir, this
will become irrelevant.

Signed-off-by: Rob Browning <r...@defaultvalue.org>
Tested-by: Rob Browning <r...@defaultvalue.org>
---
lib/bup/drecurse.py | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/bup/drecurse.py b/lib/bup/drecurse.py
index 4653ad73..9d790bbd 100644
--- a/lib/bup/drecurse.py
+++ b/lib/bup/drecurse.py
@@ -119,9 +119,5 @@ def recursive_dirlist(paths, xdev, bup_dir=None,
else:
prepend = path
yield (prepend,pst)
- except:
- try:
- os.fchdir(startdir)
- except:
- pass
- raise
+ finally:
+ os.fchdir(startdir)
--
2.47.3

Reply all
Reply to author
Forward
0 new messages