Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Except statement i server.py träffas inte #2

Closed
EinarJohansson opened this issue Sep 20, 2020 · 0 comments
Closed

Except statement i server.py träffas inte #2

EinarJohansson opened this issue Sep 20, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@EinarJohansson
Copy link
Owner

Felet

När man ctrl-c för att avbryta programmet träffas inte server klassens except statement för att hantera KeyboardInterupt.

Resultat

KeyboardInterrupt

Förväntat resultat

Att detta sker:

except KeyboardInterrupt:
   print('\nAvslutar servern')
   self.sock.close()
   self.kö.join()
   break

Hypotes

Jag tror att eftersom tråden är en daemon raisas KeyboardInterupt i main funktionen istället för inuti klassens funktion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants