From 1d62185fb1eb7b9523ec45666c3d96863b91e9af Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 10 Oct 2013 15:12:11 +0200 Subject: apt, aptsources: Only call init_config() if not already initialized Based on an idea by the bug reporter. Reported-by: Dominique Lasserre Closes: #686403 --- apt/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt') diff --git a/apt/__init__.py b/apt/__init__.py index 4ded8e29..7b04befb 100644 --- a/apt/__init__.py +++ b/apt/__init__.py @@ -25,7 +25,9 @@ from apt.package import Package from apt.cache import Cache, ProblemResolver from apt.cdrom import Cdrom -# init the package system -apt_pkg.init() +# init the package system, but do not re-initialize config +if "APT" not in apt_pkg.config: + apt_pkg.init_config() +apt_pkg.init_system() __all__ = ['Cache', 'Cdrom', 'Package'] -- cgit v1.2.3