diff --git a/resources/lib/plex_companion.py b/resources/lib/plex_companion.py index 25cf12aa..fb55a637 100644 --- a/resources/lib/plex_companion.py +++ b/resources/lib/plex_companion.py @@ -300,7 +300,7 @@ class PlexCompanion(backgroundthread.KillableThread): start_count = 0 while True: try: - httpd = listener.ThreadedHTTPServer( + httpd = listener.PKCHTTPServer( client, subscription_manager, ('', v.COMPANION_PORT), diff --git a/resources/lib/plexbmchelper/listener.py b/resources/lib/plexbmchelper/listener.py index f89a9e23..1b6ce3a3 100644 --- a/resources/lib/plexbmchelper/listener.py +++ b/resources/lib/plexbmchelper/listener.py @@ -5,8 +5,7 @@ Plex Companion listener """ from logging import getLogger from re import sub -from socketserver import ThreadingMixIn -from http.server import HTTPServer, BaseHTTPRequestHandler +from http.server import ThreadingHTTPServer, BaseHTTPRequestHandler from .. import utils, companion, json_rpc as js, clientinfo, variables as v from .. import app @@ -227,12 +226,7 @@ class MyHandler(BaseHTTPRequestHandler): self.response(v.COMPANION_OK_MESSAGE, headers) -class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): - """ - Using ThreadingMixIn Thread magic - """ - daemon_threads = True - +class PKCHTTPServer(ThreadingHTTPServer): def __init__(self, client, subscription_manager, *args, **kwargs): """ client: Class handle to plexgdm.plexgdm. We can thus ask for an up-to- @@ -242,4 +236,4 @@ class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): """ self.client = client self.subscription_manager = subscription_manager - HTTPServer.__init__(self, *args, **kwargs) + super().__init__(*args, **kwargs)