File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,12 @@ def self.Py_None
174
174
end
175
175
176
176
attach_variable :PyType_Type , PyTypeObjectStruct
177
- attach_variable :_PyNone_Type , PyTypeObjectStruct
177
+
178
+ if libpython . find_variable ( '_PyNone_Type' )
179
+ attach_variable :PyNone_Type , :_PyNone_Type , PyTypeObjectStruct
180
+ else
181
+ attach_variable :PyNone_Type , PyTypeObjectStruct
182
+ end
178
183
179
184
if libpython . find_variable ( 'PyInt_Type' )
180
185
has_PyInt_Type = true
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ module PyCall
59
59
end
60
60
61
61
it 'works for Python type objects' do
62
- pynone_type = PyPtr . incref ( PyPtr . new ( LibPython . _PyNone_Type . to_ptr . address ) )
62
+ pynone_type = PyPtr . incref ( PyPtr . new ( LibPython . PyNone_Type . to_ptr . address ) )
63
63
pylong_type = PyPtr . incref ( PyPtr . new ( LibPython . PyLong_Type . to_ptr . address ) )
64
64
65
65
expect ( PyPtr ::None . kind_of? ( pynone_type ) ) . to eq ( true )
You can’t perform that action at this time.
0 commit comments