portage base module to the portree module, so that the base portage
module can be imported without triggering import of the portage.process
(for atexit_register) and portage.dbapi.porttree modules. Also, don't
bother to commit the mtimedb in the exit hook since it's not really
needed.
def portageexit():
if data.secpass > 1 and os.environ.get("SANDBOX_ON") != "1":
close_portdbapi_caches()
- try:
- mtimedb
- except NameError:
- pass
- else:
- mtimedb.commit()
-
-atexit_register(portageexit)
def create_trees(config_root=None, target_root=None, trees=None):
if trees is None:
for i in portdbapi.portdbapi_instances:
i.close_caches()
+portage.process.atexit_register(portage.portageexit)
+
class portagetree(object):
def __init__(self, root=None, virtual=None, settings=None):
"""