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

Set threads created by ThreadingMixin to be deamons and non-blocking #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pytest_sftpserver/sftp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ def host_key(self):
return RSAKey.from_private_key_file(SERVER_KEY_PRIVATE)


class SFTPServer(Thread, ThreadingMixIn, TCPServer):
class SFTPServer(Thread, ThreadingMixIn, TCPServer):
daemon_threads = True
block_on_close = False

def __init__(self, content_object=None, content_provider_class=ContentProvider):
self.content_provider = content_provider_class(content_object)
TCPServer.__init__(self, ("127.0.0.1", 0), SFTPRequestHandler, False)
Expand Down