Remove speculative AttributeError guard in URL-fix wrapper
This commit is contained in:
+2
-16
@@ -188,14 +188,7 @@ def _patch_restic(module):
|
|||||||
try:
|
try:
|
||||||
return dataclasses.replace(result, cmd=cmd)
|
return dataclasses.replace(result, cmd=cmd)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
try:
|
return result._replace(cmd=cmd)
|
||||||
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
|
|
||||||
break
|
break
|
||||||
if i and cmd[i - 1] in ("-r", "--repo", "--repository"):
|
if i and cmd[i - 1] in ("-r", "--repo", "--repository"):
|
||||||
scheme, sep, rest = part.partition(":")
|
scheme, sep, rest = part.partition(":")
|
||||||
@@ -204,14 +197,7 @@ def _patch_restic(module):
|
|||||||
try:
|
try:
|
||||||
return dataclasses.replace(result, cmd=cmd)
|
return dataclasses.replace(result, cmd=cmd)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
try:
|
return result._replace(cmd=cmd)
|
||||||
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
|
|
||||||
break
|
break
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user