diff options
author | jaseg <code@jaseg.net> | 2016-07-31 21:29:03 +0200 |
---|---|---|
committer | jaseg <code@jaseg.net> | 2016-07-31 21:29:03 +0200 |
commit | 35de5ecc9378a6f1944b75a92597f9405e93061e (patch) | |
tree | d3fe820303351dd1d92c081fa107e2722ff822ac /mpv.py | |
parent | 8d8b061fcc2b606c893c4fd460318a118b00ddbc (diff) | |
download | python-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.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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: |