Re: [Distutils] Bootstrap use_setuptools() in ez_setup.py failure

2011-01-19 Thread Pherl Liu
Hmm, I think it now only delete pkg_resource when
pkg_resrouces.VersionConflict is caught, but the fix should be also delete
pkg_resources when pkg_resources.DistributionNotFound is caught. The code
looks like:

   try:
pkg_resources.require("setuptools>="+version); return
except pkg_resources.VersionConflict, e:
if was_imported:
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available,
and\n"
"can't be installed while this script is running. Please
install\n"
" a more recent version first, using 'easy_install -U
setuptools'."
"\n\n(Currently using %r)"
) % (version, e.args[0])
sys.exit(2)
else:
del pkg_resources, sys.modules['pkg_resources']# reload ok
return do_download()
except pkg_resources.DistributionNotFound:
*del pkg_resources, sys.modules['pkg_resources']*  #  added this
line.
return do_download()


On Thu, Jan 20, 2011 at 12:53 AM, P.J. Eby  wrote:

> At 03:40 PM 1/19/2011 +0800, Pherl Liu wrote:
>
>> Well..
>>
>> I think I can fix this by editing ez_setup.py
>>
>> adding oneline after pkg_resources.DistributionNotFound is caught, in
>> use_setuptools()
>>
>> del pkg_resources, sys.modules['pkg_resources']
>>
>> Not sure if this makes sense.
>>
>
> That's already in current versions of ez_setup.py; 0.6c9 is several years
> old.  I'd suggest you use the svn externals to keep it up-to-date.  See:
>
>
> http://peak.telecommunity.com/DevCenter/setuptools#managing-multiple-projects
>
> for details.
>
>
>
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] Bootstrap use_setuptools() in ez_setup.py failure

2011-01-19 Thread P.J. Eby

At 03:40 PM 1/19/2011 +0800, Pherl Liu wrote:

Well..

I think I can fix this by editing ez_setup.py

adding oneline after pkg_resources.DistributionNotFound is caught, 
in use_setuptools()


del pkg_resources, sys.modules['pkg_resources']

Not sure if this makes sense.


That's already in current versions of ez_setup.py; 0.6c9 is several 
years old.  I'd suggest you use the svn externals to keep it up-to-date.  See:


  http://peak.telecommunity.com/DevCenter/setuptools#managing-multiple-projects

for details.


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig