diff options
| author | Colin Watson <cjwatson@canonical.com> | 2012-11-19 13:22:42 +0000 |
|---|---|---|
| committer | Colin Watson <cjwatson@canonical.com> | 2012-11-19 13:22:42 +0000 |
| commit | a0ecfe1c745e07c41c85b80d747b19179341531d (patch) | |
| tree | f3a428be5067397aa2585b31890ccd3b949b6f2b | |
| parent | 386f2f98ac0860d3d34c60127232703fb0122001 (diff) | |
| download | python-apt-a0ecfe1c745e07c41c85b80d747b19179341531d.tar.gz | |
* aptsources/distinfo.py, aptsources/distro.py, aptsources/sourceslist.py,
tests/test_apt_cache.py, tests/test_debfile_multiarch.py:
- Use logging.warning rather than the deprecated logging.warn.
| -rw-r--r-- | aptsources/distinfo.py | 3 | ||||
| -rw-r--r-- | aptsources/distro.py | 2 | ||||
| -rw-r--r-- | aptsources/sourceslist.py | 2 | ||||
| -rw-r--r-- | debian/changelog | 3 | ||||
| -rw-r--r-- | tests/test_apt_cache.py | 8 | ||||
| -rw-r--r-- | tests/test_debfile_multiarch.py | 4 |
6 files changed, 13 insertions, 9 deletions
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py index e0ee915d..d80721e5 100644 --- a/aptsources/distinfo.py +++ b/aptsources/distinfo.py @@ -172,7 +172,8 @@ class DistInfo(object): stdout=PIPE).communicate()[0].strip() 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) dist = "Debian" self.dist = dist diff --git a/aptsources/distro.py b/aptsources/distro.py index ca87a919..82fd67ba 100644 --- a/aptsources/distro.py +++ b/aptsources/distro.py @@ -465,7 +465,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 diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py index 40902d84..f5a86ecb 100644 --- a/aptsources/sourceslist.py +++ b/aptsources/sourceslist.py @@ -375,7 +375,7 @@ class SourcesList(object): source = SourceEntry(line, file) self.list.append(source) except: - logging.warn("could not open file '%s'\n" % file) + logging.warning("could not open file '%s'\n" % file) def save(self): """ save the current sources """ diff --git a/debian/changelog b/debian/changelog index 39685bef..d9083659 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,9 @@ python-apt (0.8.8ubuntu4) UNRELEASED; urgency=low * tests/test_auth.py: - Discard stderr from gpg. - Try successive keyserver ports if 19191 is already in use. + * aptsources/distinfo.py, aptsources/distro.py, aptsources/sourceslist.py, + tests/test_apt_cache.py, tests/test_debfile_multiarch.py: + - Use logging.warning rather than the deprecated logging.warn. -- Colin Watson <cjwatson@ubuntu.com> Mon, 19 Nov 2012 11:57:28 +0000 diff --git a/tests/test_apt_cache.py b/tests/test_apt_cache.py index 3cf89c07..fe90eb8a 100644 --- a/tests/test_apt_cache.py +++ b/tests/test_apt_cache.py @@ -34,7 +34,7 @@ def if_sources_list_is_readable(f): if os.access("/etc/apt/sources.list", os.R_OK): f(*args, **kwargs) else: - logging.warn("skipping '%s' because sources.list is not readable" % f) + logging.warning("skipping '%s' because sources.list is not readable" % f) return wrapper @@ -42,7 +42,7 @@ def get_open_file_descriptors(): try: fds = os.listdir("/proc/self/fd") except OSError: - logging.warn("failed to list /proc/self/fd") + logging.warning("failed to list /proc/self/fd") return set([]) return set(map(int, fds)) @@ -122,7 +122,7 @@ class TestAptCache(TestCase): cache = apt.Cache(rootdir="./data/test-provides/") cache.open() if len(cache) == 0: - logging.warn("skipping test_get_provided_packages, cache empty?!?") + logging.warning("skipping test_get_provided_packages, cache empty?!?") return # a true virtual pkg l = cache.get_providing_packages("mail-transport-agent") @@ -135,7 +135,7 @@ class TestAptCache(TestCase): # create highlevel cache and get the lowlevel one from it highlevel_cache = apt.Cache(rootdir="./data/test-provides") if len(highlevel_cache) == 0: - logging.warn("skipping test_log_level_pkg_provides, cache empty?!?") + logging.warning("skipping test_log_level_pkg_provides, cache empty?!?") return # low level cache provides list of the pkg cache = highlevel_cache._cache diff --git a/tests/test_debfile_multiarch.py b/tests/test_debfile_multiarch.py index 7c02a32a..8da070aa 100644 --- a/tests/test_debfile_multiarch.py +++ b/tests/test_debfile_multiarch.py @@ -23,7 +23,7 @@ class TestDebfileMultiarch(unittest.TestCase): def test_multiarch_deb_check(self): if apt_pkg.get_architectures() != ["amd64", "i386"]: - logging.warn("skipping test because running on a non-multiarch system") + logging.warning("skipping test because running on a non-multiarch system") return deb = apt.debfile.DebPackage( "./data/test_debs/multiarch-test1_i386.deb") @@ -37,7 +37,7 @@ class TestDebfileMultiarch(unittest.TestCase): # use "lib3ds-1-3" as a test to see if non-multiach lib conflicts work canary = "lib3ds-1-3" if not canary in cache: - logging.warn("skipping test because %s is missing" % canary) + logging.warning("skipping test because %s is missing" % canary) return cache[canary].mark_install() deb = apt.debfile.DebPackage( |
