# HG changeset patch # User btimby # Date 1328412623 0 # Node ID 06f1c0a8557dbd9e5ad87ff5519411d896a34bbe # Parent d4563cb0376c8b0cb207e28422e07e73cc0abb13 Loosen restriction for what is considered a "valid" queue backend. diff -r d4563cb0376c -r 06f1c0a8557d queues/__init__.py --- a/queues/__init__.py Sun Feb 05 03:28:19 2012 +0000 +++ b/queues/__init__.py Sun Feb 05 03:30:23 2012 +0000 @@ -20,7 +20,7 @@ * http://code.google.com/p/stomperl/ * RabbitMQ """ -import os +import os, inspect __version__ = "0.6.2" @@ -58,6 +58,5 @@ raise InvalidBackend("Unable to import QUEUE BACKEND '%s'" % BACKEND) # Check that this is really a queues backend, not just some other random # module. - from .backends.base import BaseQueue - if not getattr(queues, 'Queue', None) in BaseQueue.__subclasses__(): - raise InvalidBackend("Unable to import QUEUE_BACKEND '%s' does not appear to be valid." % BACKEND) + if not inspect.isclass(getattr(queues, 'Queue', None)): + raise InvalidBackend("Unable to import QUEUE BACKEND '%s' does not appear to be valid." % BACKEND) diff -r d4563cb0376c -r 06f1c0a8557d queues/backends/__init__.py --- a/queues/backends/__init__.py Sun Feb 05 03:28:19 2012 +0000 +++ b/queues/backends/__init__.py Sun Feb 05 03:30:23 2012 +0000 @@ -1,4 +1,4 @@ -import os +import os, inspect from queues import InvalidBackend __all__ = ['backend'] @@ -25,6 +25,5 @@ backend = __import__(BACKEND, {}, {}, ['']) except ImportError: raise InvalidBackend("Unable to import QUEUE BACKEND '%s'" % BACKEND) - from .base import BaseQueue - if not getattr(backend, 'Queue', None) in BaseQueue.__subclasses__(): + if not inspect.isclass(getattr(backend, 'Queue', None)): raise InvalidBackend("Unable to import QUEUE BACKEND '%s' does not appear to be valid." % BACKEND)