Skip to content

Commit

Permalink
fixup Pyhton c interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Jul 31, 2024
1 parent 2b01664 commit d5933c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion msprime/_msprimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2470,7 +2470,9 @@ Simulator_individual_to_python(Simulator *self, segment_t *ind)
PyObject *t = NULL;
size_t num_segments, j;
segment_t *u;
lineage_t *lin = ind->lineage;

assert(lin != NULL);
num_segments = 0;
u = ind;
while (u != NULL) {
Expand All @@ -2485,7 +2487,7 @@ Simulator_individual_to_python(Simulator *self, segment_t *ind)
j = 0;
while (u != NULL) {
t = Py_BuildValue("(d,d,I,I)", u->left, u->right, u->value,
u->population);
lin->population);
if (t == NULL) {
Py_DECREF(l);
goto out;
Expand Down

0 comments on commit d5933c1

Please sign in to comment.