Skip to content
Snippets Groups Projects

WS-601: fixing potential sites of UnboundLocalError

Merged Janet Goldstein requested to merge WS-601-fix-ref-before-assign-err into main
1 unresolved thread
5 files
+ 20
13
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -69,7 +69,6 @@ class ManifestIF(ManifestComponentIF):
self.telescope = telescope
self.parameters = self.build_ingest_parameters(additional_metadata)
self.files_found = [file for file in self.staging_source_dir.iterdir()]
def build_ingest_parameters(self, additional_metadata: AbstractTextFile):
@@ -270,10 +269,14 @@ class IngestionManifestBuilder:
# find science product (we expect just one for this SP type)
tars_found = find_output_tars(self.files_found, self.staging_source_dir)
sci_prod = None
for file in tars_found:
sci_prod = OutputScienceProduct(type=self.sp_type, filename=file.name)
break
return OutputGroup(science_products=[sci_prod])
if sci_prod:
return OutputGroup(science_products=[sci_prod])
def _build_imaging_output_group(self) -> OutputGroup:
"""
Loading