Remove speculative AttributeError guard in URL-fix wrapper

This commit is contained in:
2026-06-15 15:10:16 +00:00
parent cc43b2831d
commit 0ce2083c71
+2 -16
View File
@@ -188,14 +188,7 @@ def _patch_restic(module):
try:
return dataclasses.replace(result, cmd=cmd)
except TypeError:
try:
return result._replace(cmd=cmd)
except AttributeError:
sys.stderr.write(
"[truecloud-patch] WARNING: cannot fix repo URL; "
f"unexpected ResticConfig type {type(result).__name__!r}\n"
)
return result
return result._replace(cmd=cmd)
break
if i and cmd[i - 1] in ("-r", "--repo", "--repository"):
scheme, sep, rest = part.partition(":")
@@ -204,14 +197,7 @@ def _patch_restic(module):
try:
return dataclasses.replace(result, cmd=cmd)
except TypeError:
try:
return result._replace(cmd=cmd)
except AttributeError:
sys.stderr.write(
"[truecloud-patch] WARNING: cannot fix repo URL; "
f"unexpected ResticConfig type {type(result).__name__!r}\n"
)
return result
return result._replace(cmd=cmd)
break
return result