do not fail on missing zopehome

This commit is contained in:
Frédéric Péters 2013-10-15 00:01:58 +02:00
parent afa833e22c
commit f683c8eb11
1 changed files with 5 additions and 2 deletions

View File

@ -49,8 +49,11 @@ def file_source(context):
items.append(('previous', _('Previous Version')))
config = getConfiguration()
version_templates = os.path.join(config.zopehome, 'etc',
'version_templates', 'list.json')
try:
version_templates = os.path.join(config.zopehome, 'etc',
'version_templates', 'list.json')
except AttributeError:
version_templates = '/ foo'
if os.path.exists(version_templates):
templates = json.load(file(version_templates))
for entry in templates: