Skip to content

Commit ec0340e

Browse files
committed
ruff checks
1 parent d827ca6 commit ec0340e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/P6/genotype.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def to_variation_descriptor(self) -> "pps2.VariationDescriptor":
212212
hv = validator.encode_hgvs(c_part)
213213
vi = hv.to_variant_interpretation_202()
214214
vd = vi.variation_descriptor
215-
except requests.RequestException as exc:
215+
except requests.RequestException:
216216
# Network/HTTP issues: keep runs resilient by falling back
217217
return self._build_local_vd()
218218
except (ValueError, TypeError, KeyError):
@@ -228,9 +228,11 @@ def to_variation_descriptor(self) -> "pps2.VariationDescriptor":
228228
# Gene context (if missing)
229229
try:
230230
gene_ctx = getattr(vd, "gene_context", None)
231-
if self.gene_symbol and (gene_ctx is None or not getattr(gene_ctx, "symbol", "")):
231+
if self.gene_symbol and (
232+
gene_ctx is None or not getattr(gene_ctx, "symbol", "")
233+
):
232234
vd.gene_context.symbol = self.gene_symbol
233-
except Exception:
235+
except (AttributeError, ValueError, TypeError):
234236
# Don't let proto accessors sink the run
235237
pass
236238

@@ -304,11 +306,9 @@ def _build_local_vd(self) -> "pps2.VariationDescriptor":
304306
if self.gene_symbol:
305307
try:
306308
vd.gene_context.symbol = self.gene_symbol
307-
except Exception:
309+
except (AttributeError, ValueError, TypeError):
308310
pass
309311

310-
return vd
311-
312312
@staticmethod
313313
def _add_hgvs_expression(
314314
vd: "pps2.VariationDescriptor", value: str, syntax_name: str = "HGVS"

0 commit comments

Comments
 (0)