summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFahad Siddiqui <mfahad@platalytics.com>2016-03-29 17:34:11 +0500
committerAsk Solem <ask@celeryproject.org>2016-04-12 12:54:41 -0700
commit662ad2e61780fcae508aff8363fc10b5d7c1498f (patch)
tree35a3c5a6f8e899d18967abf50f7b0999a50d8e39
parentcbffbc190c99988158f140f834f13ce3d6b97f9e (diff)
downloadpy-amqp-662ad2e61780fcae508aff8363fc10b5d7c1498f.tar.gz
checked for one more version of librt.so
-rw-r--r--amqp/five.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/amqp/five.py b/amqp/five.py
index 8b281db..5911374 100644
--- a/amqp/five.py
+++ b/amqp/five.py
@@ -12,6 +12,7 @@ from __future__ import absolute_import
# ############# py3k #########################################################
import sys
+import errno
PY3 = sys.version_info[0] == 3
try:
@@ -171,7 +172,17 @@ if sys.version_info < (3, 3):
('tv_nsec', ctypes.c_long),
]
- librt = ctypes.CDLL('librt.so.1', use_errno=True)
+ try:
+ librt = ctypes.CDLL('librt.so.1', use_errno=True)
+ except Exception:
+ try:
+ librt = ctypes.CDLL('librt.so.0', use_errno=True)
+ except Exception as exc:
+ error = OSError(
+ 'Could not detect working librt library: {0}'.format(
+ exc))
+ error.errno = errno.ENOENT
+ raise error
clock_gettime = librt.clock_gettime
clock_gettime.argtypes = [
ctypes.c_int, ctypes.POINTER(timespec),