From c063c748e1e1d94c06816364904647300b733c56 Mon Sep 17 00:00:00 2001 From: Minchul Lee Date: Sat, 6 Jun 2020 16:23:06 +0900 Subject: [PATCH] fixed for GDMR without metadata_range --- src/python/py_GDMR.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/python/py_GDMR.cpp b/src/python/py_GDMR.cpp index 43369b0..068fba5 100644 --- a/src/python/py_GDMR.cpp +++ b/src/python/py_GDMR.cpp @@ -47,10 +47,11 @@ static int GDMR_init(TopicModelObject *self, PyObject *args, PyObject *kwargs) self->minWordDf = minDf; self->removeTopWord = rmTop; - if (objRange) + if (objRange && objRange != Py_None) { vector vMin, vMax; py::UniqueObj rangeIter = PyObject_GetIter(objRange), item; + if(!rangeIter) throw runtime_error{ "`metadata_range` must be a list of pairs." }; while (item = PyIter_Next(rangeIter)) { item = PyObject_GetIter(item);