Skip to content

Commit 8f5c0fb

Browse files
committed
use getattr with default for more compact code
per PR review comments
1 parent c3bb6db commit 8f5c0fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pyuvsim/simsetup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def initialize_catalog_from_params(obs_params, input_uv=None, return_recarray=Tr
978978
# If the filename parameter doesn't exist on the sky object
979979
# (because of an older version of pyradiosky) or if it is None (e.g. for mock skies)
980980
# add the source_list_name to the object so it can be put in the UVData history later
981-
if not hasattr(sky, "filename") or sky.filename is None:
981+
if getattr(sky, "filename", None) is None:
982982
sky.filename = source_list_name
983983

984984
if return_recarray:

0 commit comments

Comments
 (0)