On Mon, Dec 27, 2010 at 8:57 AM, Victor Stinner <victor.stin...@haypocalc.com> wrote: > Le dimanche 26 décembre 2010 à 14:10 +0000, exar...@twistedmatrix.com a > écrit : >> On 25 Dec, 10:31 pm, mer...@netwok.org wrote: >> >>faulthandler is a module: enable the handler is simple as "import >> >>faulthandler". >> > >> >That sounds like a source of unwanted behavior (aka problems) if the >> >handler is enabled by 1Cpydoc faulthandler 1D or by a pkgutil walk. You >> >may want to consider using a function to enable the functionality (and >> >add one to disable it). >> >> Enormous +1. > > I don't know pkgutil. How does it work? In which case would it load the > faulthandler module? > > faulthandler is currently only written in C.
pkgutil includes a function that lets you walk the entire module heirarchy, implicitly importing everything, including all the builtin modules. It's one of the reasons doing things as side-effects of import is considered highly undesirable. The pydoc tests do this when they bring the (docstring-based) documentation server up to check its handling of HTTP requests. (we recently picked up an implicit addition of a logging handler by concurrent.futures due to this effect). Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com