mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-17 17:22:07 +00:00
python: Fix yaml.load warnings
Since pyyaml 5.1 yaml.load without specifing loader is deprecated Details: https://msg.pyyaml.org/load To keep code compatible with older versions of pyyaml and keep best perfomance CLoader with fallback to Loader is used.
This commit is contained in:
@@ -14,6 +14,11 @@
|
||||
|
||||
import yaml
|
||||
|
||||
try:
|
||||
from yaml import CLoader as Loader
|
||||
except ImportError:
|
||||
from yaml import Loader as Loader
|
||||
|
||||
|
||||
class TestCase(object):
|
||||
"""
|
||||
@@ -45,7 +50,7 @@ class TestCase(object):
|
||||
"""
|
||||
doc_string = self.test_method.__doc__
|
||||
try:
|
||||
doc = yaml.load(doc_string)
|
||||
doc = yaml.load(doc_string, Loader=Loader)
|
||||
except (AttributeError, OSError, UnicodeDecodeError):
|
||||
doc = self.DEFAULT_CASE_DOC
|
||||
doc.update(self.test_method.env_args)
|
||||
|
Reference in New Issue
Block a user