Skip to content

Commit

Permalink
Addressed new issues raised by Pylint 3.1
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <maiera@de.ibm.com>
  • Loading branch information
andy-maier committed Mar 9, 2024
1 parent e834b29 commit f638cab
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions docs/changes.rst
Expand Up @@ -35,6 +35,8 @@ Released: not yet

**Cleanup:**

* Addressed new issues raised by Pylint 3.1.

**Known issues:**

* See `list of open issues`_.
Expand Down
1 change: 1 addition & 0 deletions zhmcclient/_auto_updater.py
Expand Up @@ -193,6 +193,7 @@ def registered_objects(self, uri):
"""
if uri in self._registered_objects:
id_dict = self._registered_objects[uri]
# pylint: disable=use-yield-from
for res_obj in id_dict.values():
yield res_obj

Expand Down
6 changes: 2 additions & 4 deletions zhmcclient/_timestats.py
Expand Up @@ -187,10 +187,8 @@ def end(self):
self._begin_time = None
self._count += 1
self._sum += dt
if dt > self._max:
self._max = dt
if dt < self._min:
self._min = dt
self._max = max(self._max, dt)
self._min = min(self._min, dt)

def __str__(self):
"""
Expand Down
9 changes: 5 additions & 4 deletions zhmcclient_mock/_idpool.py
Expand Up @@ -73,10 +73,11 @@ def _expand(self):
"""
assert not self._free # free pool is empty
expand_end = self._expand_start + self._expand_len
if expand_end > self._range_end:
# This happens if the size of the value range is not a multiple
# of the expansion chunk size.
expand_end = self._range_end

# Limit the expansion. This happens if the size of the value range is
# not a multiple of the expansion chunk size.
expand_end = min(expand_end, self._range_end)

if self._expand_start == expand_end:
raise ValueError("Out of capacity in ID pool")
self._free = set(range(self._expand_start, expand_end))
Expand Down

0 comments on commit f638cab

Please sign in to comment.