Skip to content

Commit 3f71df6

Browse files
committedMar 7, 2019
[processing] Avoid more deprecation warnings from external libraries
(cherry picked from commit 2ff0d59)
1 parent cc3d5fb commit 3f71df6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed
 

‎python/plugins/processing/algs/help/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525

2626
import os
2727
import codecs
28-
import yaml
28+
import warnings
29+
with warnings.catch_warnings():
30+
warnings.filterwarnings("ignore", category=DeprecationWarning)
31+
import yaml
32+
2933
from qgis.core import QgsSettings, Qgis
3034
from qgis.PyQt.QtCore import QLocale, QCoreApplication
3135

@@ -37,10 +41,12 @@ def loadShortHelp():
3741
if f.endswith("yaml"):
3842
filename = os.path.join(path, f)
3943
with codecs.open(filename, encoding='utf-8') as stream:
40-
for k, v in yaml.load(stream).items():
41-
if v is None:
42-
continue
43-
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v)
44+
with warnings.catch_warnings():
45+
warnings.filterwarnings("ignore", category=DeprecationWarning)
46+
for k, v in yaml.load(stream).items():
47+
if v is None:
48+
continue
49+
h[k] = QCoreApplication.translate("{}Algorithm".format(f[:-5].upper()), v)
4450

4551
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
4652
overrideLocale = QgsSettings().value('locale/overrideFlag', False, bool)

0 commit comments

Comments
 (0)
Please sign in to comment.