You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ariatosca.apache.org by em...@apache.org on 2017/08/31 23:20:16 UTC

incubator-ariatosca git commit: Use YAML C library

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite f29cc2ffe -> 7d875915b


Use YAML C library


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/7d875915
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/7d875915
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/7d875915

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: 7d875915b0a87cd153ecdeb14d89e3dc27f79b19
Parents: f29cc2f
Author: Tal Liron <ta...@gmail.com>
Authored: Thu Aug 31 18:20:03 2017 -0500
Committer: Tal Liron <ta...@gmail.com>
Committed: Thu Aug 31 18:20:03 2017 -0500

----------------------------------------------------------------------
 aria/parser/reading/yaml.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7d875915/aria/parser/reading/yaml.py
----------------------------------------------------------------------
diff --git a/aria/parser/reading/yaml.py b/aria/parser/reading/yaml.py
index f5eac43..1a16260 100644
--- a/aria/parser/reading/yaml.py
+++ b/aria/parser/reading/yaml.py
@@ -82,7 +82,11 @@ class YamlReader(Reader):
             # see issue here:
             # https://bitbucket.org/ruamel/yaml/issues/61/roundtriploader-causes-exceptions-with
             #yaml_loader = yaml.RoundTripLoader(data)
-            yaml_loader = yaml.SafeLoader(data)
+            try:
+                # Faster C-based loader, might not be available on all platforms
+                yaml_loader = yaml.CSafeLoader(data)
+            except:
+                yaml_loader = yaml.SafeLoader(data)
             try:
                 node = yaml_loader.get_single_node()
                 locator = YamlLocator(self.loader.location, 0, 0)