diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-10-18 11:51:44 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-10-18 11:51:44 +0200 |
| commit | 3bf6b76611bf0b148d495e2e4aae08546e54fa94 (patch) | |
| tree | 52a21ae6f4742644a5709b3a160c862d818e821f /aptsources/distro.py | |
| parent | d9deeabe21f828ae4301c4aab5073f775f954e25 (diff) | |
| download | python-apt-3bf6b76611bf0b148d495e2e4aae08546e54fa94.tar.gz | |
fix compat issues with python3
Diffstat (limited to 'aptsources/distro.py')
| -rw-r--r-- | aptsources/distro.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/aptsources/distro.py b/aptsources/distro.py index 23192f50..d4b65645 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -22,6 +22,7 @@ # USA import gettext +import logging import re import os import sys @@ -451,9 +452,9 @@ def _lsb_release(): # Convert to unicode string, needed for Python 3.1 out = out.decode("utf-8") result.update(l.split(":\t") for l in out.split("\n") if ':\t' in l) - except OSError, exc: + except OSError as exc: if exc.errno != errno.ENOENT: - print 'WARNING: lsb_release failed, using defaults:', exc + logging.warn('lsb_release failed, using defaults:' % exc) return result |
