Simplify the fix using or.

Signed-off-by: Natanael Arndt <arndtn@gmail.com>
This commit is contained in:
Natanael Arndt 2023-07-26 16:29:39 +02:00 committed by Muayyad Alsadi
parent e5cdce4e7d
commit 0164c1db56

View File

@ -1375,11 +1375,7 @@ def resolve_extends(services, service_names, environ):
content = content["services"]
subdirectory = os.path.dirname(filename)
content = rec_subs(content, environ)
from_service = (
{}
if content.get(from_service_name, {}) is None
else content.get(from_service_name, {})
)
from_service = content.get(from_service_name, {}) or {}
normalize_service(from_service, subdirectory)
else:
from_service = services.get(from_service_name, {}).copy()