diff options
| author | Michael Vogt <egon@debian-devbox> | 2013-05-08 19:09:21 +0200 |
|---|---|---|
| committer | Michael Vogt <egon@debian-devbox> | 2013-05-08 19:09:21 +0200 |
| commit | e2e4d3dd3dc2a41469f5d559cbdb5ca6c5057f01 (patch) | |
| tree | 6c3655648f24418b207422ff3125632bebf53962 /aptsources/distro.py | |
| parent | 7cf77010c108df676d3e277716f790b994bba28e (diff) | |
| parent | b805a16a7466a99bf0952b0ccc0dc7c5b3c6f797 (diff) | |
| download | python-apt-e2e4d3dd3dc2a41469f5d559cbdb5ca6c5057f01.tar.gz | |
merged from experimental and uploaded to sid
Diffstat (limited to 'aptsources/distro.py')
| -rw-r--r-- | aptsources/distro.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/aptsources/distro.py b/aptsources/distro.py index 15b93823..e9facbfb 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -164,7 +164,11 @@ class Distribution(object): fname = "/usr/share/xml/iso-codes/iso_3166.xml" if os.path.exists(fname): et = ElementTree(file=fname) - it = et.getiterator('iso_3166_entry') + # python2.6 compat, the next two lines can get removed + # once we do not use py2.6 anymore + if getattr(et, "iter", None) is None: + et.iter = et.getiterator + it = et.iter('iso_3166_entry') for elm in it: try: descr = elm.attrib["common_name"] @@ -466,7 +470,7 @@ def _lsb_release(): result.update(l.split(":\t") for l in out.split("\n") if ':\t' in l) except OSError as exc: if exc.errno != errno.ENOENT: - logging.warn('lsb_release failed, using defaults:' % exc) + logging.warning('lsb_release failed, using defaults:' % exc) return result |
