File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -284,7 +284,7 @@ pycall_pyptr_get_ob_type(VALUE obj)
284
284
{
285
285
PyObject * pyobj = get_pyobj_ptr (obj );
286
286
if (pyobj ) {
287
- VALUE pytypeobj = pycall_pyptr_new (( PyObject * ) pyobj -> ob_type );
287
+ VALUE pytypeobj = pycall_pytypeptr_new ( pyobj -> ob_type );
288
288
return pytypeobj ;
289
289
}
290
290
return Qnil ;
@@ -381,6 +381,12 @@ pycall_pytypeptr_allocate(VALUE klass)
381
381
return TypedData_Wrap_Struct (klass , & pycall_pytypeptr_data_type , NULL );
382
382
}
383
383
384
+ VALUE
385
+ pycall_pytypeptr_new (PyTypeObject * pytypeobj )
386
+ {
387
+ return pycall_pyptr_new_with_klass (cPyTypePtr , (PyObject * )pytypeobj );
388
+ }
389
+
384
390
static VALUE
385
391
pycall_pytypeptr_get_ob_size (VALUE obj )
386
392
{
Original file line number Diff line number Diff line change @@ -299,6 +299,7 @@ PyObject* pycall_pyptr_get_pyobj_ptr(VALUE obj);
299
299
VALUE pycall_pyptr_new (PyObject * pyobj );
300
300
VALUE pycall_pyptr_incref (VALUE pyptr );
301
301
VALUE pycall_pyptr_decref (VALUE pyptr );
302
+ VALUE pycall_pytypeptr_new (PyTypeObject * pytypeobj );
302
303
303
304
#if defined(__cplusplus )
304
305
#if 0
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ module PyCall
46
46
47
47
describe '#__ob_type__' do
48
48
it 'returns a PyPtr for None' do
49
- expect ( PyPtr ::None . __ob_type__ ) . to be_a ( PyPtr )
49
+ expect ( PyPtr ::None . __ob_type__ ) . to be_a ( PyTypePtr )
50
50
end
51
51
end
52
52
You can’t perform that action at this time.
0 commit comments