From 538cdcc22d22c3ba3c50552274add3ebde07170e Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Thu, 9 Mar 2017 00:00:23 +0530 Subject: [PATCH] Move picard.log import to block level to avoid circular dependencies --- picard/util/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/picard/util/__init__.py b/picard/util/__init__.py index 8f62f7e60..dd13ba230 100644 --- a/picard/util/__init__.py +++ b/picard/util/__init__.py @@ -31,7 +31,6 @@ from PyQt4 import QtCore from string import Template # Required for compatibility with lastfmplus which imports this from here rather than loading it direct. from functools import partial -from picard import log from picard.const import MUSICBRAINZ_SERVERS if sys.platform == 'darwin': @@ -40,6 +39,7 @@ if sys.platform == 'darwin': NSURL_IMPORTED = True except ImportError: NSURL_IMPORTED = False + from picard import log log.warning("Unable to import NSURL, file drag'n'drop might not work correctly") @@ -450,6 +450,8 @@ def union_sorted_lists(list1, list2): def get_file_path(url): # Workaround for https://bugreports.qt.io/browse/QTBUG-40449 # OSX Urls follow the NSURL scheme and need to be converted + from picard import log + file_path = "" if sys.platform == 'darwin' and unicode(url.path()).startswith('/.file/id='): if NSURL_IMPORTED: