summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-04 13:45:50 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-01-04 13:45:50 +0100
commit92d91e71d95efa0245a48664a37b754ebf304f89 (patch)
tree1ef80e192dcdf99103b33d46afadd3b1cc30f12a
parentdd637c2e6946d10d42be926ac89ae4707bd5e2e9 (diff)
downloadtrollius-92d91e71d95efa0245a48664a37b754ebf304f89.tar.gz
Fix asyncio.time_monotonic on Mac OS X
-rw-r--r--README4
-rw-r--r--TODO3
-rw-r--r--asyncio/time_monotonic.py5
-rw-r--r--setup.py2
4 files changed, 11 insertions, 3 deletions
diff --git a/README b/README
index 9ad7699..9835262 100644
--- a/README
+++ b/README
@@ -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
diff --git a/TODO b/TODO
index 6c117ba..1115286 100644
--- a/TODO
+++ b/TODO
@@ -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
diff --git a/setup.py b/setup.py
index db22d26..5866219 100644
--- a/setup.py
+++ b/setup.py
@@ -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/",