Skip to content

Commit 13f2b65

Browse files
authored
Merge pull request opencog#73 from vsbogd/fix-singnet-master-build
Fix build after latest API changes from opencog
2 parents 67433a7 + e99abc4 commit 13f2b65

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

opencog/cython/opencog/ptrvalue.pyx

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cdef class PtrValue(Value):
66
if obj is not None:
77
Py_INCREF(obj)
88
cvalue = createPtrValue(<void*>obj, decref)
9-
super(PtrValue, self).__init__(ValuePtr.create(cvalue))
9+
super(PtrValue, self).__init__(PtrHolder.create(<shared_ptr[void]&>cvalue))
1010
else:
1111
super(PtrValue, self).__init__(value_ptr)
1212

@@ -17,5 +17,4 @@ cdef void decref(void* obj):
1717
Py_DECREF(<object>obj)
1818

1919
def valueToPtrValue(value):
20-
return PtrValue(value_ptr =
21-
ValuePtr.create((<Value>value).get_c_value_ptr()))
20+
return PtrValue(value_ptr = (<Value>value).ptr_holder)

tests/cython/backwardchainer/test_bc.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ def test_bc_deduction(self):
6060

6161
chainer.do_chain()
6262
results = chainer.get_results()
63-
resultAC = results.get_out()[0]
63+
resultAC = None
64+
for result in results.get_out():
65+
if result.get_out()[0].name == "A":
66+
resultAC = result
67+
break
68+
self.assertTrue(resultAC is not None)
6469
self.assertTrue(resultAC.tv == AB.tv)
6570
self.assertEquals("A", resultAC.get_out()[0].name)
6671
self.assertEquals("C", resultAC.get_out()[1].name)

0 commit comments

Comments
 (0)