Bug 477836 - sets module is deprecated
Summary: sets module is deprecated
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pykickstart
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-24 02:15 UTC by David Cantrell
Modified: 2009-01-05 20:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-05 20:39:20 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description David Cantrell 2008-12-24 02:15:39 UTC
Python 2.6 warns that the sets module is now deprecated, and parser.py is using it.  Would the regular built-in set() type work?

diff --git a/pykickstart/parser.py b/pykickstart/parser.py
index ee01983..04eef05 100644
--- a/pykickstart/parser.py
+++ b/pykickstart/parser.py
@@ -38,7 +38,6 @@ import string
 import tempfile
 from copy import copy
 from optparse import *
-from sets import *
 from urlgrabber import urlopen
 import urlgrabber.grabber as grabber
 
@@ -333,10 +332,10 @@ class Packages:
         """Given a list of lines from the input file, strip off any leading
            symbols and add the result to the appropriate list.
         """
-        existingExcludedSet = Set(self.excludedList)
-        existingPackageSet = Set(self.packageList)
-        newExcludedSet = Set()
-        newPackageSet = Set()
+        existingExcludedSet = set(self.excludedList)
+        existingPackageSet = set(self.packageList)
+        newExcludedSet = set()
+        newPackageSet = set()
 
         for pkg in pkgList:
             stripped = pkg.strip()

Comment 1 Chris Lumens 2009-01-05 20:39:20 UTC
Yes that should work.  python's builtin set type supports all the operations that the old sets.Set did.  Thanks for the patch.


Note You need to log in before you can comment on or make changes to this bug.