tags 586443 + patch
thanks

On Sat, Jun 19, 2010 at 07:14:29PM +0200, Holger Levsen wrote:
> Hi Roland,
> 
> thanks for your bugreport!
> 
> On Samstag, 19. Juni 2010, Roland Stigge wrote:
> > # piuparts asp_1.8-7_i386.changes
> > /usr/sbin/piuparts:48: DeprecationWarning: the sets module is deprecated
> >   import sets
> > /usr/sbin/piuparts:53: DeprecationWarning: please use 'debian' instead of
> > 'debian_bundle' from debian_bundle import deb822
> > Guessed: debian
> 
> the problem is that piuparts.d.o runs piuparts on lenny, where no 
> debian_bundle exists. 
> 
> I assume the module should be loaded conditionally.

Sorry; we (the python-debian team) probably should have given some time
where loading debian_bundle didn't raise a DeprecationWarning.  Anyway,
the attached patch should squelch both warnings.

-- 
John Wright <j...@debian.org>
Index: piuparts.py
===================================================================
--- piuparts.py	(revision 689)
+++ piuparts.py	(working copy)
@@ -45,13 +45,15 @@
 import stat
 import re
 import pickle
-import sets
 import subprocess
 import unittest
 import urllib
 import uuid
-from debian_bundle import deb822
 
+try:
+    from debian import deb822
+except ImportError:
+    from debian_bundle import deb822
 
 class Defaults:
 
@@ -1445,7 +1447,7 @@
 
 def offending_packages(meta_infos, file_owners):
     """Return a Set of offending packages."""
-    pkgset = sets.Set()
+    pkgset = set()
     for name, data in meta_infos:
         if name in file_owners:
             for pkg in file_owners[name]:

Reply via email to