diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-01-04 13:45:50 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-01-04 13:45:50 +0100 |
commit | 92d91e71d95efa0245a48664a37b754ebf304f89 (patch) | |
tree | 1ef80e192dcdf99103b33d46afadd3b1cc30f12a | |
parent | dd637c2e6946d10d42be926ac89ae4707bd5e2e9 (diff) | |
download | trollius-92d91e71d95efa0245a48664a37b754ebf304f89.tar.gz |
Fix asyncio.time_monotonic on Mac OS X
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | asyncio/time_monotonic.py | 5 | ||||
-rw-r--r-- | setup.py | 2 |
4 files changed, 11 insertions, 3 deletions
@@ -77,6 +77,10 @@ grow in heavy, wet clay soils. Change log ========== +Development version + +- Fix asyncio.time_monotonic on Mac OS X + 2014-01-04: version 0.1 - First public release @@ -1,3 +1,6 @@ +* add COPYING file +* add AUTHORS file and fill author field in setup.py + (mention Tulip authors) * Fix failing tests: - test_futures.py diff --git a/asyncio/time_monotonic.py b/asyncio/time_monotonic.py index f8f0e27..c820e92 100644 --- a/asyncio/time_monotonic.py +++ b/asyncio/time_monotonic.py @@ -58,6 +58,7 @@ elif sys.platform == 'darwin': # Mac OS X: use mach_absolute_time() and mach_timebase_info() try: import ctypes + import ctypes.util libc_name = ctypes.util.find_library('c') except ImportError: libc_name = None @@ -73,7 +74,7 @@ elif sys.platform == 'darwin': ('numer', ctypes.c_uint32), ('denom', ctypes.c_uint32), ) - mach_timebase_info_data_p = POINTER(mach_timebase_info_data_t) + mach_timebase_info_data_p = ctypes.POINTER(mach_timebase_info_data_t) mach_timebase_info = libc.mach_timebase_info mach_timebase_info.argtypes = (mach_timebase_info_data_p,) @@ -83,7 +84,7 @@ elif sys.platform == 'darwin': return mach_absolute_time() * time_monotonic.factor timebase = mach_timebase_info_data_t() - mach_timebase_info(byref(timebase)) + mach_timebase_info(ctypes.byref(timebase)) time_monotonic.factor = float(timebase.numer) / timebase.denom * 1e-9 del timebase @@ -28,7 +28,7 @@ setup( name="trollius", version="0.1", - description="Experimental port (asyncio module, PEP 3156) of the Tulip project on Python 2.7", + description="Experimental port of the Tulip project (asyncio module, PEP 3156) on Python 2.7", long_description=open("README").read(), url="https://bitbucket.org/haypo/trollius/", |