remove useless try/except clause

exception will be caught and logged later in Pelican stack
This commit is contained in:
Bruno Binet 2012-10-25 14:24:13 +02:00
commit b6cc6bd2d4

View file

@ -87,15 +87,13 @@ def copy(path, source, destination, destination_path=None, overwrite=False):
if overwrite: if overwrite:
shutil.rmtree(destination_) shutil.rmtree(destination_)
shutil.copytree(source_, destination_) shutil.copytree(source_, destination_)
logger.info('replacement of %s with %s' % (source_, destination_)) logger.info('replacement of %s with %s' % (source_,
destination_))
elif os.path.isfile(source_): elif os.path.isfile(source_):
try: dest_dir = os.path.dirname(destination_)
dest_dir = os.path.dirname(destination_) if not os.path.exists(dest_dir):
if not os.path.exists(dest_dir): os.makedirs(dest_dir)
os.makedirs(dest_dir)
except OSError, e:
logger.error("copying: %s -> %s: %r" % (source_, dest_dir, e))
shutil.copy(source_, destination_) shutil.copy(source_, destination_)
logger.info('copying %s to %s' % (source_, destination_)) logger.info('copying %s to %s' % (source_, destination_))