Kaydet (Commit) ff76e166 authored tarafından Barış Metin's avatar Barış Metin

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

üst 89f39b7f
......@@ -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
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment