diff options
| author | Julian Andres Klode <jak@debian.org> | 2009-07-17 14:10:21 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2009-07-17 14:10:21 +0200 |
| commit | b63d93492cba1ffd11454ab37e751ef6f938ff96 (patch) | |
| tree | e5eac907be9f33c4cb822a6cb9efb5aba0255e47 /doc | |
| parent | 5dbe872723f375db9f5d371051f6a9756fdc4c60 (diff) | |
| download | python-apt-b63d93492cba1ffd11454ab37e751ef6f938ff96.tar.gz | |
doc/source/conf.py: Ignore failures to import apt_pkg.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/source/conf.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py index 5a289f32..86e6868c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -16,6 +16,7 @@ # All configuration values have a default; values that are commented out # serve to show the default. import os +import glob import sys # If your extensions are in another directory, add it here. If the directory @@ -27,13 +28,21 @@ sys.path.insert(0, os.path.abspath('../..')) # Find the path to the built apt_pkg and apt_inst extensions if os.path.exists("../../build"): version = '.'.join(str(x) for x in sys.version_info[:2]) - for dirname in os.listdir('../../build'): - if version in dirname: - sys.path.insert(0, os.path.abspath('../../build/' + dirname)) + for apt_pkg_path in glob.glob('../../build/lib*%s/apt_pkg.so' % version): + sys.path.insert(0, os.path.dirname(apt_pkg_path)) + try: + import apt_pkg + except ImportError, exc: + # Not the correct version + sys.stderr.write('W: Ignoring error %s\n' % exc) + sys.path.pop(0) + else: + sys.stdout.write('I: Found apt_pkg.so in %s\n' % sys.path[0]) + # Hack: Disable compatibility mode + apt_pkg._COMPAT_0_7 = 0 + break + -# Hack: Disable compatibility mode -import apt_pkg -apt_pkg._COMPAT_0_7 = 0 # General configuration # --------------------- |
