[pypy-commit] pypy default: Return -1 on failure (as opposed to just 1)
fijal
noreply at buildbot.pypy.org
Fri Feb 28 17:06:02 CET 2014
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch:
Changeset: r69558:a73ce680712f
Date: 2014-02-28 18:05 +0200
http://bitbucket.org/pypy/pypy/changeset/a73ce680712f/
Log: Return -1 on failure (as opposed to just 1)
diff --git a/pypy/doc/embedding.rst b/pypy/doc/embedding.rst
--- a/pypy/doc/embedding.rst
+++ b/pypy/doc/embedding.rst
@@ -38,13 +38,13 @@
* ``verbose``: if non-zero, would print error messages to stderr
- Function returns 0 on success or 1 on failure, can be called multiple times
+ Function returns 0 on success or -1 on failure, can be called multiple times
until the library is found.
.. function:: int pypy_execute_source(char* source);
Execute the source code given in the ``source`` argument. Will print
- the error message to stderr upon failure and return 1, otherwise returns 0.
+ the error message to stderr upon failure and return -1, otherwise returns 0.
You should really do your own error handling in the source. It'll acquire
the GIL.
diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -117,7 +117,7 @@
debug("OperationError:")
debug(" operror-type: " + e.w_type.getname(space))
debug(" operror-value: " + space.str_w(space.str(e.get_w_value(space))))
- return 1
+ return -1
@entrypoint('main', [rffi.CCHARP], c_name='pypy_execute_source')
def pypy_execute_source(ll_source):
@@ -175,7 +175,7 @@
debug("OperationError:")
debug(" operror-type: " + e.w_type.getname(space))
debug(" operror-value: " + space.str_w(space.str(e.get_w_value(space))))
- return 1
+ return -1
return 0
return entry_point, {'pypy_execute_source': pypy_execute_source,
More information about the pypy-commit
mailing list