ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From emblempar...@apache.org
Subject incubator-ariatosca git commit: Use YAML C library [Forced Update!]
Date Thu, 31 Aug 2017 23:24:25 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-1-parser-test-suite 7d875915b -> d71783f0a (forced update)


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/d71783f0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/d71783f0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/d71783f0

Branch: refs/heads/ARIA-1-parser-test-suite
Commit: d71783f0a4fa64e623e50d0c996e5cfa99689520
Parents: f29cc2f
Author: Tal Liron <tal.liron@gmail.com>
Authored: Thu Aug 31 18:20:03 2017 -0500
Committer: Tal Liron <tal.liron@gmail.com>
Committed: Thu Aug 31 18:24:20 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/d71783f0/aria/parser/reading/yaml.py
----------------------------------------------------------------------
diff --git a/aria/parser/reading/yaml.py b/aria/parser/reading/yaml.py
index f5eac43..0148d3a 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 BaseException:
+                yaml_loader = yaml.SafeLoader(data)
             try:
                 node = yaml_loader.get_single_node()
                 locator = YamlLocator(self.loader.location, 0, 0)


Mime
View raw message