do guarded programming, but don't absorb errors. it's no good :).

This commit is contained in:
Barış Metin
2005-09-23 16:13:39 +00:00
parent 89f39b7f00
commit ff76e166bd
2 changed files with 8 additions and 9 deletions
+3 -4
View File
@@ -146,10 +146,9 @@ class ArchiveZip(ArchiveBase):
ofile = os.path.join(target_dir, outpath)
if is_dir: # this is a directory
try: # To get rid of Error:[Errno 17] File exists: errors
os.makedirs(os.path.join(target_dir, outpath))
except OSError:
pass
d = os.path.join(target_dir, outpath)
if not os.path.isdir(d):
os.makedirs(d)
continue
# check that output dir is present
+5 -5
View File
@@ -44,12 +44,12 @@ def remove_single(package_name):
if os.path.isfile(fpath):
os.rename(fpath, fpath + ".pisi")
else:
try:
# check if file is removed manually.
# And we don't remove directories!
# FIXME: should give a warning if it is...
if os.path.isfile(fpath):
os.unlink(fpath)
except OSError:
# file is removed (maybe manually)
# FIXME: should give a warning
pass
ctx.installdb.remove(package_name)
packagedb.remove_package(package_name)