summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2023-01-18 08:08:58 +0000
committerInada Naoki <songofacandy@gmail.com>2023-01-18 08:08:58 +0000
commitc3995669f1f821596714240c2cd07943810f8658 (patch)
treec73d1e8062c25d59e201f7f5190c2ae1601e6b2c
parent44a80603838ea480e66c9235036ff742f4013200 (diff)
downloadmsgpack-python-c3995669f1f821596714240c2cd07943810f8658.tar.gz
Remove unused code
-rw-r--r--msgpack/pack.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/msgpack/pack.h b/msgpack/pack.h
index 4f3ce1d..1e849ac 100644
--- a/msgpack/pack.h
+++ b/msgpack/pack.h
@@ -71,7 +71,6 @@ static inline int msgpack_pack_write(msgpack_packer* pk, const char *data, size_
static inline int
msgpack_pack_unicode(msgpack_packer *pk, PyObject *o, long long limit)
{
-#if PY_MAJOR_VERSION >= 3
assert(PyUnicode_Check(o));
Py_ssize_t len;
@@ -87,31 +86,6 @@ msgpack_pack_unicode(msgpack_packer *pk, PyObject *o, long long limit)
if (ret) return ret;
return msgpack_pack_raw_body(pk, buf, len);
-#else
- PyObject *bytes;
- Py_ssize_t len;
- int ret;
-
- // py2
- bytes = PyUnicode_AsUTF8String(o);
- if (bytes == NULL)
- return -1;
-
- len = PyString_GET_SIZE(bytes);
- if (len > limit) {
- Py_DECREF(bytes);
- return -2;
- }
-
- ret = msgpack_pack_raw(pk, len);
- if (ret) {
- Py_DECREF(bytes);
- return -1;
- }
- ret = msgpack_pack_raw_body(pk, PyString_AS_STRING(bytes), len);
- Py_DECREF(bytes);
- return ret;
-#endif
}
#ifdef __cplusplus