do guarded programming, but don't absorb errors. it's no good :).
This commit is contained in:
+3
-4
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user