Skip to content

fixed a issue that causes RuntimeError in Python 3#3

Merged
capoony merged 1 commit intocapoony:masterfrom
Sfeng666:patch-2
Jul 28, 2021
Merged

fixed a issue that causes RuntimeError in Python 3#3
capoony merged 1 commit intocapoony:masterfrom
Sfeng666:patch-2

Conversation

@Sfeng666
Copy link
Contributor

Hi Martin,

It's really appreciated that you've upgraded your code to Python 3, making it more compatible with the current environment.

Recently, my colleague reported a runtime error that is caused by changing dictionary size during iteration when running PoolSNP.py. This error won't corrupt the whole script or affect the result, but people might get nervous about an 'error' being raised. Thus, I add a '.copy()' to your line 232 to avoid this issue.

Interestingly, Python 2 won't report this runtime error when a dictionary size is changed during iteration, but Python 3 does. I also noticed you have added .copy() to line 198 when filtering totalalleles by mincount or minfreq, so you've probably realized this issue but forgot to modify the other line.

@capoony capoony merged commit e230961 into capoony:master Jul 28, 2021
@capoony
Copy link
Owner

capoony commented Jul 28, 2021

Hi Siyuan,

awesome! Thanks a lot for spotting this.

Cheers, Martin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants