Skip to content

Commit a7f5651

Browse files
committed
Address review
1 parent ebd9752 commit a7f5651

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Lib/threading.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@
5050
_HAVE_THREAD_NATIVE_ID = False
5151
try:
5252
_set_name = _thread.set_name
53-
_HAVE_SET_NAME = True
5453
except AttributeError:
55-
_HAVE_SET_NAME = False
54+
_set_name = None
5655
ThreadError = _thread.error
5756
try:
5857
_CRLock = _thread.RLock
@@ -1032,7 +1031,7 @@ def _bootstrap_inner(self):
10321031
self._set_ident()
10331032
if _HAVE_THREAD_NATIVE_ID:
10341033
self._set_native_id()
1035-
if _HAVE_SET_NAME and self._name:
1034+
if _set_name is not None and self._name:
10361035
_set_name(self._name)
10371036
self._started.set()
10381037
with _active_limbo_lock:

Modules/_threadmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,7 @@ Internal only. Return a non-zero integer that uniquely identifies the main threa
23642364
of the main interpreter.");
23652365

23662366

2367-
#ifdef HAVE_PTHREAD_SETNAME_NP
2367+
#ifdef HAVE_PTHREAD_GETNAME_NP
23682368
/*[clinic input]
23692369
_thread._get_name
23702370
@@ -2387,7 +2387,7 @@ _thread__get_name_impl(PyObject *module)
23872387
name[size] = 0;
23882388
return PyUnicode_DecodeFSDefault(name);
23892389
}
2390-
#endif // HAVE_PTHREAD_SETNAME_NP
2390+
#endif // HAVE_PTHREAD_GETNAME_NP
23912391

23922392

23932393
#ifdef HAVE_PTHREAD_SETNAME_NP

Modules/clinic/_threadmodule.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)