Bug 477836 - sets module is deprecated
sets module is deprecated
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: pykickstart (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-23 21:15 EST by David Cantrell
Modified: 2009-01-05 15:39 EST (History)
1 user (show)

See Also:
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: ---


Attachments (Terms of Use)

  None (edit)
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.

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