Skip to content

Commit

Permalink
Fix bug in gaps before unzipping results (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche authored Jun 20, 2024
1 parent 9491680 commit 8c01d32
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/iranges/IRanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,11 @@ def gaps(self, start: Optional[int] = None, end: Optional[int] = None) -> "IRang
gapwidth = end - max_end
out_ranges.append((gapstart, gapwidth))

_gapstarts, _gapends = zip(*out_ranges)
_gapstarts = []
_gapends = []
if len(out_ranges):
_gapstarts, _gapends = zip(*out_ranges)

return IRanges(_gapstarts, _gapends)

# folows the same logic as in https://stackoverflow.com/questions/55480499/split-set-of-intervals-into-minimal-set-of-disjoint-intervals
Expand Down

0 comments on commit 8c01d32

Please sign in to comment.