Skip to content

Fix sinter example code in README.md#22

Merged
trmue merged 1 commit intotrmue:mainfrom
jungmin-cho-eng:main
Sep 29, 2025
Merged

Fix sinter example code in README.md#22
trmue merged 1 commit intotrmue:mainfrom
jungmin-cho-eng:main

Conversation

@jungmin-cho-eng
Copy link
Contributor

This applies the second recommendation in #20.

Without wrapping the body of the sinter example code with a conditional if __name__ == "__main__":, the code produces the following error:

AttributeError: 'NoneType' object has no attribute 'kill'

According to the sinter documentation, this error occurs because the multiprocessing children spawned by sinter.collect also attempt to execute the top-level code.

# NOTE: This is actually necessary! If the code inside 'main()' was at the
# module level, the multiprocessing children spawned by sinter.collect would
# also attempt to run that code.
if __name__ == '__main__':
    main()

@trmue
Copy link
Owner

trmue commented Sep 29, 2025

Thanks!

@trmue trmue merged commit af501b5 into trmue:main Sep 29, 2025
7 checks passed
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