Skip to content
Permalink
Browse files

fix #21872 (refs #21774; partly reverts e57d1e0 and 507e327)

src/python/qgspythonutilsimpl.cpp:596 produces "lost sys.stdout" when
qgis.utils.updateAvailablePlugins() returns.
  • Loading branch information
jef-n committed Apr 4, 2019
1 parent 21280c3 commit 3d7c711db087a9ea515f0fba8e8b0abf4eb50761
Showing with 4 additions and 6 deletions.
  1. +4 −5 python/pyplugin_installer/plugindependencies.py
  2. +0 −1 python/utils.py
@@ -15,7 +15,7 @@
from configparser import NoOptionError, NoSectionError
from .version_compare import compareVersions
from . import installer as plugin_installer
from qgis.utils import updateAvailablePlugins
from qgis.utils import updateAvailablePlugins, plugins_metadata_parser


def __plugin_name_map(plugin_data_values):
@@ -28,9 +28,9 @@ def __plugin_name_map(plugin_data_values):
def __get_plugin_deps(plugin_id):

result = {}
metadata_parser = updateAvailablePlugins()
updateAvailablePlugins()
try:
parser = metadata_parser[plugin_id]
parser = plugins_metadata_parser[plugin_id]
plugin_deps = parser.get('general', 'plugin_dependencies')
except (NoOptionError, NoSectionError, KeyError):
return result
@@ -69,8 +69,7 @@ def find_dependencies(plugin_id, plugin_data=None, plugin_deps=None, installed_p

if installed_plugins is None:
updateAvailablePlugins()
metadata_parser = updateAvailablePlugins()
installed_plugins = {metadata_parser[k].get('general', 'name'): metadata_parser[k].get('general', 'version') for k, v in metadata_parser.items()}
installed_plugins = {plugins_metadata_parser[k].get('general', 'name'): metadata_parser[k].get('general', 'version') for k, v in metadata_parser.items()}

if plugin_data is None:
plugin_data = plugin_installer.plugins.all()
@@ -282,7 +282,6 @@ def updateAvailablePlugins():
available_plugins = plugins
global plugins_metadata_parser
plugins_metadata_parser = metadata_parser
return metadata_parser


def pluginMetadata(packageName, fct):

0 comments on commit 3d7c711

Please sign in to comment.
You can’t perform that action at this time.