summaryrefslogtreecommitdiff
path: root/mpv.py
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2016-07-31 21:29:03 +0200
committerjaseg <code@jaseg.net>2016-07-31 21:29:03 +0200
commit35de5ecc9378a6f1944b75a92597f9405e93061e (patch)
treed3fe820303351dd1d92c081fa107e2722ff822ac /mpv.py
parent8d8b061fcc2b606c893c4fd460318a118b00ddbc (diff)
downloadpython-mpv-35de5ecc9378a6f1944b75a92597f9405e93061e.tar.gz
python-mpv-35de5ecc9378a6f1944b75a92597f9405e93061e.tar.bz2
python-mpv-35de5ecc9378a6f1944b75a92597f9405e93061e.zip
Make this python2 compatible
Diffstat (limited to 'mpv.py')
-rw-r--r--mpv.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mpv.py b/mpv.py
index 8ee9826..865148c 100644
--- a/mpv.py
+++ b/mpv.py
@@ -3,7 +3,6 @@ from ctypes import *
import ctypes.util
import threading
import os
-import asyncio
from warnings import warn
from functools import partial
@@ -309,7 +308,7 @@ def _event_loop(event_handle, playback_cond, event_callbacks, property_handlers)
pass # It seems that when this thread runs into an exception, the MPV core is not able to terminate properly
# anymore. FIXME
-class MPV:
+class MPV(object):
""" See man mpv(1) for the details of the implemented commands. """
def __init__(self, log_handler=None, **kwargs):
""" Create an MPV instance.
@@ -329,7 +328,8 @@ class MPV:
self._playback_cond = threading.Condition()
self._event_handle = _mpv_create_client(self.handle, b'mpv-python-event-handler-thread')
loop = partial(_event_loop, self._event_handle, self._playback_cond, self.event_callbacks, self._property_handlers)
- self._event_thread = threading.Thread(target=loop, daemon=True, name='MPVEventHandlerThread')
+ self._event_thread = threading.Thread(target=loop, name='MPVEventHandlerThread')
+ self._event_thread.setDaemon(True)
self._event_thread.start()
if log_handler is not None: