skip io errors

This commit is contained in:
deepend 2021-12-31 17:46:14 -05:00
parent 6ac1ae77c3
commit ca38d62131
1 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python
import filecmp import filecmp
import os import os
@ -9,8 +9,11 @@ LINK = "1~{0} /~{0} tilde.club 70"
for user in users(): for user in users():
if os.path.exists(f"/home/{user}/public_gopher/gophermap"): if os.path.exists(f"/home/{user}/public_gopher/gophermap"):
if not filecmp.cmp( try:
"/etc/skel/public_gopher/gophermap", if not filecmp.cmp(
f"/home/{user}/public_gopher/gophermap", shallow=False): "/etc/skel/public_gopher/gophermap",
print(LINK.format(user)) f"/home/{user}/public_gopher/gophermap", shallow=False):
print(LINK.format(user))
except IOError:
pass