From 592f5dec53caa0797b80180b240a32ccceb41f90 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Sun, 29 Nov 2015 11:46:29 +0100 Subject: [PATCH] gst1: Remove deprecated GObject.threads_init() Ref https://wiki.gnome.org/Projects/PyGObject/Threading "The requirement to call GObject.threads_init() has been removed from PyGObject 3.10.2 when using Python native threads with GI (via the threading module) as well as with GI repositories which manage their own threads that may call back into Python (like GStreamer callbacks). The GObject.threads_init() function will still exist for the entire 3.x series for compatibility reasons but emits a deprecation warning." --- mopidy/__main__.py | 11 +++++------ mopidy/audio/scan.py | 3 +-- tests/audio/test_actor.py | 3 +-- tests/audio/test_scan.py | 3 +-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mopidy/__main__.py b/mopidy/__main__.py index 6d399bd4..06b7658d 100644 --- a/mopidy/__main__.py +++ b/mopidy/__main__.py @@ -9,21 +9,20 @@ import textwrap try: import gi gi.require_version('Gst', '1.0') - from gi.repository import GObject, Gst + from gi.repository import Gst except ImportError: print(textwrap.dedent(""" - ERROR: The GObject and Gst Python packages were not found. + ERROR: The GStreamer Python package was not found. - Mopidy requires GStreamer and GObject to work. These are C libraries - with a number of dependencies themselves, and cannot be installed with - the regular Python tools like pip. + Mopidy requires GStreamer to work. GStreamer is a C library with a + number of dependencies itself, and cannot be installed with the regular + Python tools like pip. Please see http://docs.mopidy.com/en/latest/installation/ for instructions on how to install the required dependencies. """)) raise -GObject.threads_init() Gst.init() try: diff --git a/mopidy/audio/scan.py b/mopidy/audio/scan.py index 718f2d6e..fdd97784 100644 --- a/mopidy/audio/scan.py +++ b/mopidy/audio/scan.py @@ -6,7 +6,7 @@ import time import gi gi.require_version('Gst', '1.0') -from gi.repository import GObject, Gst, GstPbutils +from gi.repository import Gst, GstPbutils from mopidy import exceptions from mopidy.audio import utils @@ -193,7 +193,6 @@ if __name__ == '__main__': from mopidy.internal import path - GObject.threads_init() Gst.init() scanner = Scanner(5000) diff --git a/tests/audio/test_actor.py b/tests/audio/test_actor.py index ea5e5f25..0cf89418 100644 --- a/tests/audio/test_actor.py +++ b/tests/audio/test_actor.py @@ -5,9 +5,8 @@ import unittest import gi gi.require_version('Gst', '1.0') -from gi.repository import GObject, Gst +from gi.repository import Gst -GObject.threads_init() Gst.init() import mock diff --git a/tests/audio/test_scan.py b/tests/audio/test_scan.py index ab995285..6e3ba001 100644 --- a/tests/audio/test_scan.py +++ b/tests/audio/test_scan.py @@ -5,9 +5,8 @@ import unittest import gi gi.require_version('Gst', '1.0') -from gi.repository import GObject, Gst +from gi.repository import Gst -GObject.threads_init() Gst.init() from mopidy import exceptions