Last active
December 12, 2018 16:14
-
-
Save joshp123/dcc715563cb87863b40f0e8abb5f231b to your computer and use it in GitHub Desktop.
Bare raise inside thread causes segfault
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
import logging | |
logging.basicConfig() | |
log = logging.Logger(__name__) | |
class CrashyThread(threading.Thread): | |
def run(self): | |
try: | |
log.warning("hello from crashy thread {}") | |
raise | |
except Exception: | |
log.warning("hello") | |
return | |
def main(): | |
t = CrashyThread() | |
t.daemon = True | |
t.start() | |
time.sleep(10) | |
log.warning("hello from main thread") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some specific version of python (3.4.x?) I think. It was fixed in later versions.