Bug 477836

Summary: sets module is deprecated
Product: [Fedora] Fedora Reporter: David Cantrell <dcantrell>
Component: pykickstartAssignee: Chris Lumens <clumens>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: clumens
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-01-05 15:39:20 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description David Cantrell 2008-12-23 21:15:39 EST
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 15:39:20 EST
Yes that should work.  python's builtin set type supports all the operations that the old sets.Set did.  Thanks for the patch.