Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2020-05-18 09:46:43 +0300
committerTaku Kudo <taku@google.com>2020-05-18 09:46:43 +0300
commit92ca009e0bbfe8b1ef7f65aca49b0fc9d34bc320 (patch)
treed63ae6363b7206831c049c34dcc329b83da21e5d
parent8970682ca6828f168909be7bbe701f6905ad123e (diff)
fixed test failure.
-rw-r--r--python/sentencepiece.i4
-rw-r--r--python/sentencepiece_wrap.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/python/sentencepiece.i b/python/sentencepiece.i
index 784411b..dd2fea0 100644
--- a/python/sentencepiece.i
+++ b/python/sentencepiece.i
@@ -106,7 +106,7 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
}
~PySentenceIterator() {
- if (iter_) Py_DECREF(iter_);
+ Py_XDECREF(iter_);
}
bool done() const override {
@@ -144,7 +144,7 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
status_ = sentencepiece::util::Status(sentencepiece::util::StatusCode::kInternal,
"Not a string.");
}
- Py_DECREF(item_);
+ Py_XDECREF(item_);
}
PyObject *iter_ = nullptr;
PyObject *item_ = nullptr;
diff --git a/python/sentencepiece_wrap.cxx b/python/sentencepiece_wrap.cxx
index 3bced05..bd85063 100644
--- a/python/sentencepiece_wrap.cxx
+++ b/python/sentencepiece_wrap.cxx
@@ -2877,7 +2877,7 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
}
~PySentenceIterator() {
- if (iter_) Py_DECREF(iter_);
+ Py_XDECREF(iter_);
}
bool done() const override {
@@ -2915,7 +2915,7 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
status_ = sentencepiece::util::Status(sentencepiece::util::StatusCode::kInternal,
"Not a string.");
}
- Py_DECREF(item_);
+ Py_XDECREF(item_);
}
PyObject *iter_ = nullptr;
PyObject *item_ = nullptr;