Skip to content

Commit 45e866f

Browse files
committed
Merge pull request opencv#8500 from Sahloul:fixes/wrappers/ptr
2 parents 0ae297a + 8908893 commit 45e866f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

modules/python/src2/cv2.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,14 +1274,16 @@ PyObject* pyopencv_from(const Moments& m)
12741274
template<typename T>
12751275
PyObject* pyopencv_from(const cv::Ptr<T>& p)
12761276
{
1277-
if (!p) return Py_None;
1277+
if (!p)
1278+
Py_RETURN_NONE;
12781279
return pyopencv_from(*p);
12791280
}
12801281

12811282
template <typename T>
12821283
bool pyopencv_to(PyObject *o, Ptr<T>& p, const char *name)
12831284
{
1284-
if (!o || o == Py_None) return true;
1285+
if (!o || o == Py_None)
1286+
return true;
12851287
p = makePtr<T>();
12861288
return pyopencv_to(o, *p, name);
12871289
}

0 commit comments

Comments
 (0)