[Distutils] from distutils.core import DistutilsOptionError

P.J. Eby pje at telecommunity.com
Wed Feb 24 02:28:42 CET 2010


At 06:05 PM 2/23/2010 -0500, Tarek Ziadé wrote:
>Or do you mean that you consider the exception classes located in
>Distutils to be a common need
>for people that write setup.py scripts ?

A setup script may want to explicitly throw (or catch) distutils 
errors, and having only one place to import these things from makes 
distutils easier to use.  I don't consider it a *common* need, but I 
do consider it part of distutils' "core API", in the sense that if 
your code is either invoking distutils or being invoked by it, you 
may need to throw or catch those errors.

In general, everything that's a *distutils-defined* symbol (not 
types, os, etc.) in distutils.core, I thought was intended to be 
imported from there, as they are all things that could be considered 
part of the "core API".  (And apparently, at least Thomas thought the 
same thing.)

(If I'd been writing distutils, I'd have named the module 
distutils.api rather than distutils.core, and explicitly created an 
__all__ list for it, but it's pretty much the same thing.)



More information about the Distutils-SIG mailing list