Skip to content

Commit

Permalink
Fix type to Py_BuildValue
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery authored and mergify[bot] committed May 12, 2023
1 parent be7d84f commit 332d5b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions python/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
- Add ``keep_rows`` method to table classes to support efficient in-place
table subsetting (:user:`jeromekelleher`, :pr:`2700`)

**Bugfixes**

- Fix `UnicodeDecodeError` when calling `Variant.alleles` on the `emscripten` platform.
(:user:`benjeffery`, :pr:`2754`, :issue:`2737`)

--------------------
[0.5.4] - 2023-01-13
--------------------
Expand Down
3 changes: 2 additions & 1 deletion python/_tskitmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ make_alleles(tsk_variant_t *variant)
goto out;
}
for (j = 0; j < variant->num_alleles; j++) {
item = Py_BuildValue("s#", variant->alleles[j], variant->allele_lengths[j]);
item = Py_BuildValue(
"s#", variant->alleles[j], (Py_ssize_t) variant->allele_lengths[j]);
if (item == NULL) {
Py_DECREF(t);
goto out;
Expand Down

0 comments on commit 332d5b7

Please sign in to comment.