yamlscript 0.1.46__tar.gz → 0.1.48__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {yamlscript-0.1.46/lib/yamlscript.egg-info → yamlscript-0.1.48}/PKG-INFO +1 -1
- {yamlscript-0.1.46 → yamlscript-0.1.48}/lib/yamlscript/__init__.py +13 -6
- {yamlscript-0.1.46 → yamlscript-0.1.48/lib/yamlscript.egg-info}/PKG-INFO +1 -1
- {yamlscript-0.1.46 → yamlscript-0.1.48}/setup.py +1 -1
- {yamlscript-0.1.46 → yamlscript-0.1.48}/.long_description.md +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/MANIFEST.in +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/ReadMe.md +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/lib/yamlscript.egg-info/SOURCES.txt +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/lib/yamlscript.egg-info/dependency_links.txt +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/lib/yamlscript.egg-info/requires.txt +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/lib/yamlscript.egg-info/top_level.txt +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/setup.cfg +0 -0
- {yamlscript-0.1.46 → yamlscript-0.1.48}/test/test.py +0 -0
|
@@ -16,7 +16,7 @@ object that the YAMLScript code evaluates to.
|
|
|
16
16
|
# This value is automatically updated by 'make bump'.
|
|
17
17
|
# The version number is used to find the correct shared library file.
|
|
18
18
|
# We currently only support binding to an exact version of libyamlscript.
|
|
19
|
-
yamlscript_version = '0.1.
|
|
19
|
+
yamlscript_version = '0.1.48'
|
|
20
20
|
|
|
21
21
|
import os, sys
|
|
22
22
|
import ctypes
|
|
@@ -60,7 +60,11 @@ def find_libyamlscript_path():
|
|
|
60
60
|
|
|
61
61
|
if not libyamlscript_path:
|
|
62
62
|
raise Exception(
|
|
63
|
-
"
|
|
63
|
+
"""\
|
|
64
|
+
Shared library file '%s' not found
|
|
65
|
+
Try: curl -sSL yamlscript.org/install | VERSION=%s LIB=1 bash
|
|
66
|
+
See: https://github.com/yaml/yamlscript/wiki/Installing-YAMLScript
|
|
67
|
+
""" % (libyamlscript_name, yamlscript_version))
|
|
64
68
|
|
|
65
69
|
return libyamlscript_path
|
|
66
70
|
|
|
@@ -92,12 +96,15 @@ class YAMLScript():
|
|
|
92
96
|
self.isolatethread = ctypes.c_void_p()
|
|
93
97
|
|
|
94
98
|
# Create a new GraalVM isolate:
|
|
95
|
-
libyamlscript.graal_create_isolate(
|
|
99
|
+
rc = libyamlscript.graal_create_isolate(
|
|
96
100
|
None,
|
|
97
101
|
None,
|
|
98
102
|
ctypes.byref(self.isolatethread),
|
|
99
103
|
)
|
|
100
104
|
|
|
105
|
+
if rc != 0:
|
|
106
|
+
raise Exception("Failed to create isolate")
|
|
107
|
+
|
|
101
108
|
# Compile and eval a YAMLScript string and return the result:
|
|
102
109
|
def load(self, input):
|
|
103
110
|
# Reset any previous error:
|
|
@@ -128,6 +135,6 @@ class YAMLScript():
|
|
|
128
135
|
# YAMLScript instance destructor:
|
|
129
136
|
def __del__(self):
|
|
130
137
|
# Tear down the isolate thread to free resources:
|
|
131
|
-
|
|
132
|
-
if
|
|
133
|
-
raise Exception("Failed to tear down isolate
|
|
138
|
+
rc = libyamlscript.graal_tear_down_isolate(self.isolatethread)
|
|
139
|
+
if rc != 0:
|
|
140
|
+
raise Exception("Failed to tear down isolate")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|