Package: lsb-release
Version: 3.2-20
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch jaunty

Anders Kaseorg <ande...@mit.edu> submitted this patch (tweaked by me to
preserve compatibility with Python 2.3) to remove a DeprecationWarning
with Python 2.6. See
https://bugs.launchpad.net/ubuntu/+source/lsb/+bug/336436.

  * Replace the deprecated Python sets module with the builtin set type,
    if it is available (python >= 2.4), to avoid spewing warnings for
    python >= 2.6.  (LP: #336436)

diff -Nru lsb-3.2/lsb_release lsb-3.2/lsb_release
--- lsb-3.2/lsb_release 2009-01-15 16:26:38.000000000 -0500
+++ lsb-3.2/lsb_release 2009-03-02 03:35:11.000000000 -0500
@@ -78,7 +78,11 @@
 
     return [version]
 
-import sets
+try:
+    set # introduced in 2.4
+except NameError:
+    import sets
+    set = sets.Set
 
 # This is Debian-specific at present
 def check_modules_installed():
@@ -87,7 +91,7 @@
     if not output:
         return []
 
-    modules = sets.Set()
+    modules = set()
     for line in output.split(os.linesep):
         version, provides = line.split(' ', 1)
         version = version.split('-', 1)[0]

Thanks,

-- 
Colin Watson                                       [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to