summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-10-10 15:12:11 +0200
committerJulian Andres Klode <jak@debian.org>2013-10-10 15:12:11 +0200
commit1d62185fb1eb7b9523ec45666c3d96863b91e9af (patch)
treea4d7a25f1ee05ea6f264670c81306ba97440a7ec /apt
parent571618374ee880d00477d7379aaf01a36718db64 (diff)
downloadpython-apt-1d62185fb1eb7b9523ec45666c3d96863b91e9af.tar.gz
apt, aptsources: Only call init_config() if not already initialized
Based on an idea by the bug reporter. Reported-by: Dominique Lasserre <lasserre.d@googlemail.com> Closes: #686403
Diffstat (limited to 'apt')
-rw-r--r--apt/__init__.py6
1 files changed, 4 insertions, 2 deletions
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']