Commit 73a513c5 authored by Rocky Burt's avatar Rocky Burt

Now closing manually opened zodb connections -- thanks Stefan

parent 791f77e7
......@@ -33,13 +33,18 @@ def _product_packages():
old_product_packages[x] = m
packages = {}
products = Zope2.app().Control_Panel.Products
for product_id in products.objectIds():
product = products[product_id]
if hasattr(product, 'package_name'):
packages[product_id] = __import__(product.package_name)
elif old_product_packages.has_key(product_id):
packages[product_id] = old_product_packages[product_id]
app = Zope2.app()
try:
products = app.Control_Panel.Products
for product_id in products.objectIds():
product = products[product_id]
if hasattr(product, 'package_name'):
packages[product_id] = __import__(product.package_name)
elif old_product_packages.has_key(product_id):
packages[product_id] = old_product_packages[product_id]
finally:
app._p_jar.close()
return packages
......
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