Allow existing symlinks

This commit is contained in:
nolash 2021-09-09 09:32:25 +02:00
parent 3c4acd82ff
commit 2c72349ddc
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -216,7 +216,10 @@ if __name__ == '__main__':
f.write(to_checksum_address(new_address_clean))
f.close()
os.symlink(os.path.realpath(filepath), meta_phone_filepath)
try:
os.symlink(os.path.realpath(filepath), meta_phone_filepath)
except FileExistsError as e:
logg.warning('phone pointer for {} already exists: {}'.format(new_address_clean, e))
# custom data
@ -239,8 +242,10 @@ if __name__ == '__main__':
f.write(json.dumps(tag_data))
f.close()
os.symlink(os.path.realpath(filepath), custom_filepath)
try:
os.symlink(os.path.realpath(filepath), custom_filepath)
except FileExistsError as e:
logg.warning('custom data pointer for {} already exists: {}'.format(new_address_clean, e))
i += 1
sys.stdout.write('imported {} {}'.format(i, u).ljust(200) + "\r")