diff options
| author | Barry Warsaw | 2009-05-16 11:08:46 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-05-16 11:08:46 -0400 |
| commit | 7e23b2f358806cb14b92dc7833ce773738534d41 (patch) | |
| tree | 5499b536a163ebb4dedab62f4f7a97b460cece18 /src/mailman/bin/qrunner.py | |
| parent | ad07de3dcdbf0ef11b5b324b9521b748da207fc7 (diff) | |
| download | mailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.gz mailman-7e23b2f358806cb14b92dc7833ce773738534d41.tar.zst mailman-7e23b2f358806cb14b92dc7833ce773738534d41.zip | |
Diffstat (limited to 'src/mailman/bin/qrunner.py')
| -rw-r--r-- | src/mailman/bin/qrunner.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mailman/bin/qrunner.py b/src/mailman/bin/qrunner.py index 99cb564bc..318b62c68 100644 --- a/src/mailman/bin/qrunner.py +++ b/src/mailman/bin/qrunner.py @@ -23,6 +23,7 @@ from mailman.config import config from mailman.core.logging import reopen from mailman.i18n import _ from mailman.options import Options +from mailman.utilities.modules import find_name COMMASPACE = ', ' @@ -133,19 +134,17 @@ def make_qrunner(name, slice, range, once=False): class_path = 'mailman.queue' + name else: class_path = name - package, dot, class_name = class_path.rpartition('.') try: - __import__(package) - except ImportError, e: + qrclass = find_name(class_path) + except ImportError as error: if config.options.options.subproc: # Exit with SIGTERM exit code so the master watcher won't try to # restart us. print >> sys.stderr, _('Cannot import runner module: $module_name') - print >> sys.stderr, e + print >> sys.stderr, error sys.exit(signal.SIGTERM) else: raise - qrclass = getattr(sys.modules[package], class_name) if once: # Subclass to hack in the setting of the stop flag in _do_periodic() class Once(qrclass): |
