Skip to content

Commit 5ee96cf

Browse files
committed
Clean up Py_buffer definition
Now that python2.7 support is dropped.
1 parent ce0e0c7 commit 5ee96cf

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎src/pybuffer.jl‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#############################################################################
77
# mirror of Py_buffer struct in Python Include/object.h
88

9+
# Stable ABI since 3.11
910
struct Py_buffer
1011
buf::Ptr{Cvoid}
1112
obj::PyPtr
@@ -18,20 +19,15 @@ struct Py_buffer
1819
shape::Ptr{Cssize_t}
1920
strides::Ptr{Cssize_t}
2021
suboffsets::Ptr{Cssize_t}
21-
22-
# some opaque padding fields to account for differences between
23-
# Python versions (the structure changed in Python 2.7 and 3.3)
24-
internal0::Ptr{Cvoid}
25-
internal1::Ptr{Cvoid}
26-
internal2::Ptr{Cvoid}
22+
internal::Ptr{Cvoid}
2723
end
2824

2925
mutable struct PyBuffer
3026
buf::Py_buffer
3127
PyBuffer() = begin
3228
b = new(Py_buffer(C_NULL, PyPtr_NULL, 0, 0,
3329
0, 0, C_NULL, C_NULL, C_NULL, C_NULL,
34-
C_NULL, C_NULL, C_NULL))
30+
C_NULL))
3531
finalizer(pydecref, b)
3632
return b
3733
end

0 commit comments

Comments
 (0)