14
0
Files
python-vim-vint/yaml5.patch
Tomáš Chvátal 9f706ecd10 - Fix hardcoded versions
- Add patch to build with new PyYAML 5:
  * yaml5.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-vim-vint?expand=0&rev=3
2019-03-18 11:00:47 +00:00

25 lines
996 B
Diff

From 219b733e1be2beb2f714088d3916fdb065f9abdc Mon Sep 17 00:00:00 2001
From: Daniel Hahler <github@thequod.de>
Date: Tue, 29 Jan 2019 10:50:03 +0100
Subject: [PATCH] Use yaml.safe_load (#298)
Ref: https://github.com/Kuniwak/vint/issues/279#issuecomment-458106093
---
vint/linting/config/config_file_source.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/vint/linting/config/config_file_source.py b/vint/linting/config/config_file_source.py
index 210932c8..989e123a 100644
--- a/vint/linting/config/config_file_source.py
+++ b/vint/linting/config/config_file_source.py
@@ -13,7 +13,8 @@ def __init__(self, env):
config_file_path = self.get_file_path(env)
with config_file_path.open() as file_obj:
- self._config_dict = self.convert_config_dict(yaml.load(file_obj))
+ config_yaml = yaml.safe_load(file_obj)
+ self._config_dict = self.convert_config_dict(config_yaml)
def convert_config_dict(self, yaml_dict):