kopia lustrzana https://github.com/Yakifo/amqtt
Remove fallback to yaml.load
* yaml.full_load was added in PyYAML 5.1, required is >=5.4event-logger-getattr
rodzic
10c6575f02
commit
3f05d35483
|
@ -40,11 +40,7 @@ def read_yaml_config(config_file: str) -> dict:
|
||||||
config = None
|
config = None
|
||||||
try:
|
try:
|
||||||
with open(config_file) as stream:
|
with open(config_file) as stream:
|
||||||
config = (
|
config = yaml.full_load(stream)
|
||||||
yaml.full_load(stream)
|
|
||||||
if hasattr(yaml, "full_load")
|
|
||||||
else yaml.load(stream)
|
|
||||||
)
|
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
logger.error("Invalid config_file %s: %r", config_file, exc)
|
logger.error("Invalid config_file %s: %r", config_file, exc)
|
||||||
return config
|
return config
|
||||||
|
|
Ładowanie…
Reference in New Issue