Skip to content

Commit 7aa256c

Browse files
committed
remove duplicated __sun enforcing utf-8 from encoder
1 parent dc43fc4 commit 7aa256c

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Modules/_threadmodule.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# include <pthread.h>
2222
#endif
2323
#include <errno.h>
24+
#include <string.h>
2425

2526
// ThreadError is just an alias to PyExc_RuntimeError
2627
#define ThreadError PyExc_RuntimeError
@@ -2541,15 +2542,10 @@ set_native_thread_name(const char *name)
25412542
return rc;
25422543
}
25432544

2544-
/* Helper to encode and truncate thread name; returns new reference or NULL */
2545+
/* Helper to encode and truncate thread name */
25452546
static PyObject *
25462547
encode_thread_name(PyObject *name_obj, const char *encoding)
25472548
{
2548-
#ifdef __sun
2549-
/* Solaris always uses UTF-8 */
2550-
encoding = "utf-8";
2551-
#endif
2552-
25532549
PyObject *name_encoded = PyUnicode_AsEncodedString(name_obj, encoding, "replace");
25542550
if (name_encoded == NULL) {
25552551
return NULL;

0 commit comments

Comments
 (0)