Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c399566

Browse filesBrowse files
committed
Remove unused code
1 parent 44a8060 commit c399566
Copy full SHA for c399566

File tree

Expand file treeCollapse file tree

1 file changed

+0
-26
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-26
lines changed

‎msgpack/pack.h

Copy file name to clipboardExpand all lines: msgpack/pack.h
-26Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ static inline int msgpack_pack_write(msgpack_packer* pk, const char *data, size_
7171
static inline int
7272
msgpack_pack_unicode(msgpack_packer *pk, PyObject *o, long long limit)
7373
{
74-
#if PY_MAJOR_VERSION >= 3
7574
assert(PyUnicode_Check(o));
7675

7776
Py_ssize_t len;
@@ -87,31 +86,6 @@ msgpack_pack_unicode(msgpack_packer *pk, PyObject *o, long long limit)
8786
if (ret) return ret;
8887

8988
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
11589
}
11690

11791
#ifdef __cplusplus

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.