mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-03 03:02:13 +00:00
Rename rather than copy
This commit is contained in:
1 parent
8ce4407473
commit
4b645ed1b9
1 file changed
+4
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user