Message143332
> Great! I didn't know that!
It's a new feature of Python 3.3. I added it to skip a test on old FreeBDB, see test_threadsignal.py:
------------------------
USING_PTHREAD_COND = (sys.thread_info.name == 'pthread'
and sys.thread_info.lock == 'mutex+cond')
...
@unittest.skipIf(USING_PTHREAD_COND,
'POSIX condition variables cannot be interrupted')
def test_lock_acquire_interruption(self):
------------------------
It is also used in test_os.py:
---------------
if hasattr(sys, 'thread_info') and sys.thread_info.version:
USING_LINUXTHREADS = sys.thread_info.version.startswith("linuxthreads")
else:
USING_LINUXTHREADS = False
---------------
This "linux threads" check does already exist in Python 3.2, but is uses:
---------------
libpthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
USING_LINUXTHREADS= libpthread.startswith("linuxthreads")
---------------
See also the doc:
http://docs.python.org/dev/library/sys.html#sys.thread_info |
|
Date |
User |
Action |
Args |
2011-09-01 15:58:48 | vstinner | set | recipients:
+ vstinner, neologix, sdaoden, rpointel |
2011-09-01 15:58:47 | vstinner | set | messageid: <1314892727.91.0.513474881112.issue12868@psf.upfronthosting.co.za> |
2011-09-01 15:58:47 | vstinner | link | issue12868 messages |
2011-09-01 15:58:47 | vstinner | create | |
|