Skip to content

Commit

Permalink
convert back to int
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverba137 committed Jan 10, 2025
1 parent ea16d11 commit 1e21e3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py/desiutil/bitmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ def names(self, mask=None):
raise ValueError('Unknown type or invalid shape for mask!')
if mask < 0:
mask = np.int64(mask).astype(np.uint64)
# For Numpy < 2, the operation (int & np.uint64) was not defined.
# For Numpy >= 2, this operation should be harmless.
mask = int(mask)
bitnum = 0
while 2**bitnum <= mask:
if (2**bitnum & mask):
Expand Down

0 comments on commit 1e21e3e

Please sign in to comment.