diff --git a/kombu/connection.py b/kombu/connection.py index 9d2ece23..1cc91522 100644 --- a/kombu/connection.py +++ b/kombu/connection.py @@ -9,6 +9,7 @@ Broker connection and pools. """ from __future__ import absolute_import +from __future__ import with_statement import os import sys diff --git a/kombu/log.py b/kombu/log.py index 0337a9f8..916f7141 100644 --- a/kombu/log.py +++ b/kombu/log.py @@ -4,9 +4,8 @@ import os import logging import sys -from logging.handlers import WatchedFileHandler - from .utils import cached_property +from .utils.compat import WatchedFileHandler from .utils.encoding import safe_repr, safe_str from .utils.functional import maybe_promise diff --git a/kombu/tests/__init__.py b/kombu/tests/__init__.py index 0f58c4aa..1fef7cc6 100644 --- a/kombu/tests/__init__.py +++ b/kombu/tests/__init__.py @@ -33,8 +33,8 @@ moduleindex = ("kombu.abstract", def setup(): # so coverage sees all our modules. for module in moduleindex: + print("preimporting %r for coverage..." % (module, )) try: - print("IMPORT: %r" % (module, )) __import__(module) except ImportError: pass diff --git a/kombu/utils/compat.py b/kombu/utils/compat.py index 42895a0d..bc4d69d6 100644 --- a/kombu/utils/compat.py +++ b/kombu/utils/compat.py @@ -252,10 +252,12 @@ class LifoQueue(Queue): return self.queue.pop() ############## logging.handlers.WatchedFileHandler ########################## +import logging import os -from stat import ST_DEV, ST_INO import platform as _platform +from stat import ST_DEV, ST_INO + if _platform.system() == "Windows": #since windows doesn't go with WatchedFileHandler use FileHandler instead WatchedFileHandler = logging.FileHandler