Skip to content

Commit

Permalink
Merge pull request #117 from lsst/tickets/DM-48788-hotfix
Browse files Browse the repository at this point in the history
DM-48788: Minor fixes from linting
  • Loading branch information
timj authored Feb 11, 2025
2 parents 7f23998 + ac2e205 commit c99c83e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions python/lsst/pex/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,14 +729,13 @@ def __get__(self, instance, owner=None, at=None, label="default"):
# try statements are almost free in python if they succeed
try:
return instance._storage[self.name]
except AttributeError as e:
except AttributeError:
if not isinstance(instance, Config):
return self
else:
e.add_note(
raise AttributeError(
f"Config {instance} is missing _storage attribute, likely incorrectly initialized"
)
raise
) from None

def __set__(
self, instance: Config, value: FieldTypeVar | None, at: Any = None, label: str = "assignment"
Expand Down
5 changes: 2 additions & 3 deletions python/lsst/pex/config/listField.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import collections.abc
import weakref
from collections.abc import Iterable, MutableSequence
from itertools import zip_longest
from typing import Any, Generic, overload

from .callStack import getCallStack, getStackFrame
Expand Down Expand Up @@ -230,7 +229,7 @@ def __eq__(self, other):
if len(self) != len(other):
return False

for i, j in zip_longest(self, other):
for i, j in zip(self, other, strict=True):
if i != j:
return False
return True
Expand Down Expand Up @@ -507,7 +506,7 @@ def _compare(self, instance1, instance2, shortcut, rtol, atol, output):
if not compareScalars(f"size for {name}", len(l1), len(l2), output=output):
return False
equal = True
for n, v1, v2 in zip(range(len(l1)), l1, l2, strict=False):
for n, v1, v2 in zip(range(len(l1)), l1, l2, strict=True):
result = compareScalars(
f"{name}[{n}]", v1, v2, dtype=self.dtype, rtol=rtol, atol=atol, output=output
)
Expand Down

0 comments on commit c99c83e

Please sign in to comment.