mirror of https://gitlab.com/bashrc2/epicyon
Rename rather than copy
parent
8ce4407473
commit
4b645ed1b9
6
media.py
6
media.py
|
@ -141,11 +141,13 @@ def _convertImageToLowBandwidth(imageFilename: str) -> None:
|
|||
print('WARN: timed out waiting for low bandwidth image conversion')
|
||||
break
|
||||
if os.path.isfile(lowBandwidthFilename):
|
||||
copyfile(lowBandwidthFilename, imageFilename)
|
||||
try:
|
||||
os.remove(lowBandwidthFilename)
|
||||
os.remove(imageFilename)
|
||||
except BaseException:
|
||||
pass
|
||||
os.rename(lowBandwidthFilename, imageFilename)
|
||||
if os.path.isfile(imageFilename):
|
||||
print('Image converted to low bandwidth ' + imageFilename)
|
||||
else:
|
||||
print('Low bandwidth converted image not found: ' +
|
||||
lowBandwidthFilename)
|
||||
|
|
Loading…
Reference in New Issue