This commit starts to address the issue of a non-NULL PyObject* being returned when an exception has been set by the wrapped C function. Adds a checking mechanism for PyErr_Occurred. Results in exceptions being propagated to python caller, but may introduce memory leaks for retval not being cleaned up during error.
Refs go-python/gopy #254
This CL fixes an issue with the way python import statements are generated using an realtive current directory approach that is no longer compatible with python3. The default behavior has been updated to default to a dot-relative absolute package import for "go" and compiled extension, and a configuration option has been exposed from the CLI flags down to the bind package.
A refactor of configuration options was added to avoid further expanding the number of arguments being passed through the system.
Fixesgo-python/gopy#239
* main,bind,_examples: fix tests for go 1.16
This CL fixes a number of tests that are failing under go 1.16.
Modules behave a bit differently, the //comment directives now
need a space, generated version file needs go fmt, and there was a
mis-named symbol
* ci: Update travis and appveyor for recent Go and fix pypy download links
* ci: fix typo in travis script, and adjust go to max appveyor version
* ci: update appveyor PATH to pick up proper latest go version
* fix: Re-enable test cleanup
* ci: update appveyor to pin GOROOT
* ci: update appveyor to use latest windows image
As noted in #186 the use of C.Cstring in conjunction with pybindgen leads to storage leaks. This CL attempts at fixing those by patching the output of pybindgen to call free on the leaked strings.
NOTE, that I plan to look at pybindgen to add an option to it so that it can generate the correct code. In the meantime, I think this change is useful to have since it makes the generated code much more usable.
Fixes#186.
* fixes issue #191 (slice elem method auto-wraps the handle, including extra tests in slices), and fixes py wrapper imports to include everything referenced.
* also wrap handles for map __getitem__
* also rm gopy exe
* update after previewing PR: remove gopy.gide, don't print extra py imports, undo one usage change.
* one more cmd-exe fix
Adds support for pointers to slices as output parameters:
type StrVector []string
func Fill (out *StrVector) {
*out = []string{A, B}
}
Co-authored-by: Ondřej Herman <xherman1@fi.muni.cz>
Co-authored-by: Pavel Rychlý <pary@fi.muni.cz>
Adds support for changing the names of methods and
functions in the generated Python library. For example,
the following function will be available as under the name
`hello`:
//gopy:name hello
func Hello() string { return Hello }
Co-authored-by: Ondřej Herman <xherman1@fi.muni.cz>
Co-authored-by: Pavel Rychlý <pary@fi.muni.cz>