2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 16:32:16 +00:00

Compare commits

...

8 Commits

Author SHA1 Message Date
Stefan Seefeld
47d5bc76f6 Revert "Remove obsolete Jamfile" 2022-09-05 21:43:23 -04:00
Stefan Seefeld
508da1d198 Fix windows CI builds. 2022-08-24 13:02:31 -04:00
Stefan Seefeld
271bcea8bf Don't attempt to deploy documentation from PRs. 2022-08-24 13:02:31 -04:00
Stefan Seefeld
fdd3e8b2c1 Remove obsolete Jamfile 2022-08-24 13:02:31 -04:00
Victor Stinner
a218babc8d Fix enum_type_object type on Python 3.11
The enum_type_object type inherits from PyLong_Type which is not tracked
by the GC. Instances doesn't have to be tracked by the GC: remove the
Py_TPFLAGS_HAVE_GC flag.

The Python C API documentation says:

    "To create a container type, the tp_flags field of the type object
    must include the Py_TPFLAGS_HAVE_GC and provide an implementation of
    the tp_traverse handler."

https://docs.python.org/dev/c-api/gcsupport.html

The new exception was introduced in Python 3.11 by:
https://github.com/python/cpython/issues/88429
2022-04-26 09:42:26 -04:00
Denis Arnaud
41e208ecb5 Update call_method.hpp
Was missing from https://github.com/boostorg/python/pull/320
I've tested it on one of my projects with (that patch on) Boost.Python/Boost 1.76.0 and it works well. Without that patch, there is a deprecation error.
2022-03-19 13:06:49 -04:00
Hajo Kirchhoff
f028aa4076 -fix: issue #239 exec_file does not close the FILE handle. Note: Using FILE* is a bad choice here because of possible exceptions, but Py_RunFile is a C function. This fix works, because Py_RunFile - as a C function - does not throw exceptions. 2021-08-10 12:25:40 -04:00
Hajo Kirchhoff
a060d43bf2 -fix: boost::python::exec_file completely broken when PY_VERSION_HEX >= 0x03010000. Bug: char* f pointed to a temporary buffer returned by PyBytes_AsString. This buffer was released when Py_DECREF(fb) was called. As a result, f pointed to invalid memory when being passed to Py_RunFile. 2021-08-10 12:25:40 -04:00
5 changed files with 19 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
name: deploy documentation
on: [push, pull_request]
on: [push]
jobs:
deploy:

View File

@@ -15,16 +15,26 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: microsoft/setup-msbuild@v1.1
- name: setup boost prerequisites
uses: lukka/run-vcpkg@v6
with:
vcpkgGitCommitId: '8a9a97315aefb3f8bc5d81bf66ca0025938b9c91'
vcpkgGitCommitId: '88b1071e39f13b632644d9d953738d345a4ac055'
vcpkgDirectory: '${{ runner.workspace }}/vcpkg'
vcpkgTriplet: x64-windows
vcpkgArguments: boost-config boost-core boost-function boost-graph boost-iterator boost-lexical-cast boost-mpl boost-preprocessor boost-smart-ptr boost-static-assert boost-align
vcpkgArguments: >
boost-config
boost-core
boost-function
boost-graph
boost-iterator
boost-lexical-cast
boost-mpl
boost-preprocessor
boost-smart-ptr
boost-static-assert
boost-align
- name: setup faber
#shell: 'bash'
run: |
python -m pip install --upgrade pip
python -m pip install setuptools faber numpy

View File

@@ -59,7 +59,7 @@ call_method(PyObject* self, char const* name
)
{
PyObject* const result =
PyEval_CallMethod(
PyObject_CallMethod(
self
, const_cast<char*>(name)
, const_cast<char*>("(" BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_FIXED, "O") ")")

View File

@@ -109,8 +109,8 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
PyObject *fo = Py_BuildValue("s", f);
PyObject *fb = Py_None;
PyUnicode_FSConverter(fo, &fb);
f = PyBytes_AsString(fb);
FILE *fs = fopen(f, "r");
char *f_as_uft = PyBytes_AsString(fb);
FILE *fs = fopen(f_as_uft, "r");
Py_DECREF(fo);
Py_DECREF(fb);
#elif PY_VERSION_HEX >= 0x03000000
@@ -129,6 +129,7 @@ object BOOST_PYTHON_DECL exec_file(char const *filename, object global, object l
f,
Py_file_input,
global.ptr(), local.ptr());
fclose(fs);
if (!result) throw_error_already_set();
return object(detail::new_reference(result));
}

View File

@@ -113,7 +113,6 @@ static PyTypeObject enum_type_object = {
#if PY_VERSION_HEX < 0x03000000
| Py_TPFLAGS_CHECKTYPES
#endif
| Py_TPFLAGS_HAVE_GC
| Py_TPFLAGS_BASETYPE, /* tp_flags */
0, /* tp_doc */
0, /* tp_traverse */