From 684feeaf2f32d853b02951794789830e48e75a64 Mon Sep 17 00:00:00 2001 From: Petr Vaněk Date: Thu, 19 May 2022 16:23:59 +0200 Subject: Properly close providers.json file stream. (#12794) --- synapse/config/oembed.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'synapse/config') diff --git a/synapse/config/oembed.py b/synapse/config/oembed.py index 690ffb5296..e9edea0731 100644 --- a/synapse/config/oembed.py +++ b/synapse/config/oembed.py @@ -57,9 +57,9 @@ class OembedConfig(Config): """ # Whether to use the packaged providers.json file. if not oembed_config.get("disable_default_providers") or False: - providers = json.load( - pkg_resources.resource_stream("synapse", "res/providers.json") - ) + with pkg_resources.resource_stream("synapse", "res/providers.json") as s: + providers = json.load(s) + yield from self._parse_and_validate_provider( providers, config_path=("oembed",) ) -- cgit 1.4.1