Commit 126938e4 authored by Domen Kožar's avatar Domen Kožar

fix python2.4 support

parent 792046c7
......@@ -4,6 +4,8 @@ Change History
1.6.1 (xxx)
===========
- fix Python 2.4 support (Domen Kožar)
- added travis-ci testing (Domen Kožar)
1.6.0 (2012-08-15)
......
[buildout]
develop = zc.recipe.egg_ z3c.recipe.scripts_ .
develop =
zc.recipe.egg_
z3c.recipe.scripts_
.
parts = test oltest py
versions = versions
[py]
recipe = z3c.recipe.scripts
......@@ -28,3 +32,8 @@ defaults =
'!(bootstrap|selectingpython|selecting-python)',
]
# python2.4 compatibility
[versions]
zope.interface = 3.7.0
zope.exceptions = 3.7.1
......@@ -917,7 +917,7 @@ class Buildout(UserDict.DictMixin):
if sys.platform == 'win32':
should_run += '-script.py'
if (realpath(os.path.abspath(sys.argv[0])) != should_run):
if realpath(os.path.abspath(sys.argv[0])) != should_run:
self._logger.debug("Running %r.", realpath(sys.argv[0]))
self._logger.debug("Local buildout is %r.", should_run)
self._logger.warn("Not upgrading because not running a local "
......
......@@ -174,6 +174,8 @@ class Download(object):
self.logger.info('Downloading %s' % url)
urllib._urlopener = url_opener
handle, tmp_path = tempfile.mkstemp(prefix='buildout-')
try:
try:
tmp_path, headers = urllib.urlretrieve(url, tmp_path)
if not check_md5sum(tmp_path, md5sum):
......@@ -181,8 +183,8 @@ class Download(object):
'MD5 checksum mismatch downloading %r' % url)
except IOError, e:
os.remove(tmp_path)
raise zc.buildout.UserError("Error downloading extends for URL "
"%s: %r" % (url, e[1:3]))
raise zc.buildout.UserError("Error downloading extends for URL"
" %s: %r" % (url, e[1:3]))
except Exception, e:
os.remove(tmp_path)
raise
......
......@@ -1182,10 +1182,10 @@ def develop(setup, dest,
if log_level < logging.DEBUG:
logger.debug("in: %r\n%s", directory, ' '.join(args))
try:
subprocess.check_call([_safe_arg(executable)] + args)
except subprocess.CalledProcessError:
raise zc.buildout.UserError("Installing develop egg failed")
p = subprocess.Popen(
[_safe_arg(executable)] + args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if p.wait() > 0:
raise zc.buildout.UserError("Installing develop egg failed: %s" % p.stderr.read())
return _copyeggs(tmp3, dest, '.egg-link', undo)
......
......@@ -290,7 +290,5 @@ Create a broken egg
... eggs = broken
... """ % dict(new_releases=new_releases))
>>> import subprocess
>>> subprocess.check_call([buildout])
Traceback (most recent call last):
...
CalledProcessError: Command '['/sample-buildout/bin/buildout']' returned non-zero exit status 1
>>> subprocess.call([buildout])
1
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment