File tree Expand file tree Collapse file tree 1 file changed +0
-26
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +0
-26
lines changed
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ static inline int msgpack_pack_write(msgpack_packer* pk, const char *data, size_
71
71
static inline int
72
72
msgpack_pack_unicode (msgpack_packer * pk , PyObject * o , long long limit )
73
73
{
74
- #if PY_MAJOR_VERSION >= 3
75
74
assert (PyUnicode_Check (o ));
76
75
77
76
Py_ssize_t len ;
@@ -87,31 +86,6 @@ msgpack_pack_unicode(msgpack_packer *pk, PyObject *o, long long limit)
87
86
if (ret ) return ret ;
88
87
89
88
return msgpack_pack_raw_body (pk , buf , len );
90
- #else
91
- PyObject * bytes ;
92
- Py_ssize_t len ;
93
- int ret ;
94
-
95
- // py2
96
- bytes = PyUnicode_AsUTF8String (o );
97
- if (bytes == NULL )
98
- return -1 ;
99
-
100
- len = PyString_GET_SIZE (bytes );
101
- if (len > limit ) {
102
- Py_DECREF (bytes );
103
- return -2 ;
104
- }
105
-
106
- ret = msgpack_pack_raw (pk , len );
107
- if (ret ) {
108
- Py_DECREF (bytes );
109
- return -1 ;
110
- }
111
- ret = msgpack_pack_raw_body (pk , PyString_AS_STRING (bytes ), len );
112
- Py_DECREF (bytes );
113
- return ret ;
114
- #endif
115
89
}
116
90
117
91
#ifdef __cplusplus
You can’t perform that action at this time.
0 commit comments