Skip to content

Commit

Permalink
Replace a try/except/finally with a nested try block.
Browse files Browse the repository at this point in the history
try/except/finally doesn't work in python 2.4.
  • Loading branch information
mbudde authored and apenwarr committed Dec 4, 2010
1 parent 0e2c294 commit b9f7636
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/bup/drecurse.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ def parse_excludes(flags):

if option == '--exclude-from':
try:
f = open(realpath(parameter))
for exclude_path in f.readlines():
excluded_paths.append(realpath(exclude_path.strip()))
except Error, e:
log("warning: couldn't read %s" % parameter)
try:
f = open(realpath(parameter))
for exclude_path in f.readlines():
excluded_paths.append(realpath(exclude_path.strip()))
except Error, e:
log("warning: couldn't read %s" % parameter)
finally:
f.close()

Expand Down

0 comments on commit b9f7636

Please sign in to comment.