From d46fee4506be73dbc52779ac9dc80277595df0da Mon Sep 17 00:00:00 2001 From: Christophe Mehay Date: Mon, 28 Aug 2017 09:46:22 +0200 Subject: [PATCH] Use safe_load for yaml parsing --- .pre-commit-config.yaml | 4 ++-- pyentrypoint/config.py | 5 ++--- setup.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f830571..8f4a2f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ - repo: git://github.com/pre-commit/pre-commit-hooks - sha: 'v0.6.0' + sha: v0.9.2 hooks: - id: check-added-large-files - id: check-docstring-first @@ -13,7 +13,7 @@ - id: requirements-txt-fixer - id: trailing-whitespace - repo: git://github.com/asottile/reorder_python_imports - sha: 3d86483455ab5bd06cc1069fdd5ac57be5463f10 + sha: v0.3.5 hooks: - id: reorder-python-imports language_version: 'python2.7' diff --git a/pyentrypoint/config.py b/pyentrypoint/config.py index db5c45e..1cc8523 100644 --- a/pyentrypoint/config.py +++ b/pyentrypoint/config.py @@ -10,8 +10,7 @@ from io import open from pwd import getpwnam from six import string_types -from yaml import load -from yaml import Loader +from yaml import safe_load from .command import Command from .constants import ENTRYPOINT_FILE @@ -122,7 +121,7 @@ class Config(ConfigMeta): self.log.critical('Entrypoint config file does not provided') return with open(self._config_file) as f: - self._config = load(stream=f, Loader=Loader) + self._config = safe_load(stream=f) self._check_config() @property diff --git a/setup.py b/setup.py index d50a6ff..b6c04d9 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup # Thanks Sam and Max -__version__ = '0.5.0' +__version__ = '0.5.1' if __name__ == '__main__': setup(