[Python-3000] Looking for advice on PEP 3101 implementation details

Guido van Rossum guido at python.org
Tue Aug 21 04:25:46 CEST 2007


On 8/20/07, Eric Smith <eric+python-dev at trueblade.com> wrote:
> Guido van Rossum wrote:
> > On 8/20/07, Eric Smith <eric+python-dev at trueblade.com> wrote:
>
> >> Modules/Setup.dist contains this comment:
> >> # This only contains the minimal set of modules required to run the
> >> # setup.py script in the root of the Python source tree.
> >>
> >> I think this applies to me, as setup.py indirectly includes string.
>
> > You can ignore Makefile* and Modules/Setup*; instead, you should be
> > editing setup.py at the toplevel. Since your new module doesn't depend
> > on anything external it should be a one-line change, modeled after
> > this one:
> >
> > exts.append( Extension('_weakref', ['_weakref.c']) )
>
> But if string.py imports _formatter, then setup.py fails with being
> unable to "import string":
>
> $ ./python setup.py
> object  : ImportError('No module named _formatter',)
> type    : ImportError
> refcount: 4
> address : 0xf6f9acac
> lost sys.stderr
>
> That's why I referenced the comment in Setup.dist.

Hm, those damn dependencies. In that case I suggest adding it to sys
instead of creating a new internal method. It could be
sys._formatparser or whatever useful name you'd like to give it, as
long as it starts with an underscore. That should solve it.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list