diff options
author | Ask Solem <ask@celeryproject.org> | 2014-05-19 22:27:36 +0100 |
---|---|---|
committer | Ask Solem <ask@celeryproject.org> | 2014-05-19 22:27:36 +0100 |
commit | 55197ee34198b2ccbe8ccc57bac336b9dd42e31b (patch) | |
tree | f458b454ceed01cf0c408a9e3b2305c456a78bcc /kombu/utils/compat.py | |
parent | 4b35ccab1fc614c766301d09ac07f0d6d799fe40 (diff) | |
download | kombu-55197ee34198b2ccbe8ccc57bac336b9dd42e31b.tar.gz |
master now depends on Python 2.7
Diffstat (limited to 'kombu/utils/compat.py')
-rw-r--r-- | kombu/utils/compat.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/kombu/utils/compat.py b/kombu/utils/compat.py index 16028997..a306c672 100644 --- a/kombu/utils/compat.py +++ b/kombu/utils/compat.py @@ -8,34 +8,6 @@ Helps compatibility with older Python versions. from __future__ import absolute_import -############## timedelta_seconds() -> delta.total_seconds #################### -from datetime import timedelta - -HAVE_TIMEDELTA_TOTAL_SECONDS = hasattr(timedelta, 'total_seconds') - - -if HAVE_TIMEDELTA_TOTAL_SECONDS: # pragma: no cover - - def timedelta_seconds(delta): - """Convert :class:`datetime.timedelta` to seconds. - - Doesn't account for negative values. - - """ - return max(delta.total_seconds(), 0) - -else: # pragma: no cover - - def timedelta_seconds(delta): # noqa - """Convert :class:`datetime.timedelta` to seconds. - - Doesn't account for negative values. - - """ - if delta.days < 0: - return 0 - return delta.days * 86400 + delta.seconds + (delta.microseconds / 10e5) - ############## socket.error.errno ############################################ @@ -52,9 +24,3 @@ def get_errno(exc): except AttributeError: pass return 0 - -############## collections.OrderedDict ####################################### -try: - from collections import OrderedDict -except ImportError: - from ordereddict import OrderedDict # noqa |