aportgen: shorten hasatrr checks with getattr (MR 2271)

This commit is contained in:
Oliver Smith 2024-03-17 19:35:08 +01:00
parent 883be0f119
commit 416781d2c2
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 2 additions and 2 deletions

View file

@ -937,7 +937,7 @@ def arguments():
setattr(args, "from_argparse", copy.deepcopy(args))
setattr(args.from_argparse, "from_argparse", args.from_argparse)
if hasattr(args, "fork_alpine_retain_branch") and args.fork_alpine_retain_branch:
if getattr(args, "fork_alpine_retain_branch", False):
# fork_alpine_retain_branch largely matches the behaviour of fork_alpine, so
# just set fork_alpine here to reduce repetition.
args.fork_alpine = args.fork_alpine_retain_branch