[issue7120] logging depends on multiprocessing

Amaury Forgeot d'Arc report at bugs.python.org
Wed Oct 14 10:38:28 CEST 2009


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Whatever the value of logMultiprocessing is, I suggest to not import the
multiprocessing module if the application did not import it before:
something like:

    if "multiprocessing" in sys.modules:
        from multiprocessing import current_process
        self.processName = current_process().name
    else:
        # current_process().name returns this the first time
        self.processName = 'MainProcess'

----------
nosy: +amaury.forgeotdarc

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7120>
_______________________________________


More information about the Python-bugs-list mailing list