summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-03-08 13:50:53 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-03-08 14:12:26 +0100
commitb9b5dbc073630b53bd9c435b77e4c6744e4ab4df (patch)
treeaf1bab8c41bb8e9869d68980814d8094eb5dac91
parent2a5d2dabaff8bf3ae0ca1d25316c221155472b9b (diff)
downloadcrocoite-b9b5dbc073630b53bd9c435b77e4c6744e4ab4df.tar.gz
crocoite-b9b5dbc073630b53bd9c435b77e4c6744e4ab4df.tar.bz2
crocoite-b9b5dbc073630b53bd9c435b77e4c6744e4ab4df.zip
Use yaml.safe_load_all
load_all is deprecated. A safe YAML subset is fine for our purpose. See https://msg.pyyaml.org/load
-rw-r--r--crocoite/behavior.py2
-rw-r--r--crocoite/test_behavior.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/crocoite/behavior.py b/crocoite/behavior.py
index 3ecc92f..2d1dd0d 100644
--- a/crocoite/behavior.py
+++ b/crocoite/behavior.py
@@ -311,7 +311,7 @@ class Click (JsOnload):
def __init__ (self, loader, logger):
super ().__init__ (loader, logger)
with pkg_resources.resource_stream (__name__, os.path.join ('data', 'click.yaml')) as fd:
- self.options['sites'] = list (yaml.load_all (fd))
+ self.options['sites'] = list (yaml.safe_load_all (fd))
class ExtractLinksEvent:
__slots__ = ('links', )
diff --git a/crocoite/test_behavior.py b/crocoite/test_behavior.py
index 2c13804..8a0dff4 100644
--- a/crocoite/test_behavior.py
+++ b/crocoite/test_behavior.py
@@ -32,7 +32,7 @@ from .behavior import Scroll, Behavior, ExtractLinks, ExtractLinksEvent
from .controller import SinglePageController, EventHandler
with pkg_resources.resource_stream (__name__, os.path.join ('data', 'click.yaml')) as fd:
- sites = list (yaml.load_all (fd))
+ sites = list (yaml.safe_load_all (fd))
clickParam = []
for o in sites:
for s in o['selector']: