Commit b39bf4bb authored by Guido Trotter's avatar Guido Trotter
Browse files

SerializableConfigParser: Make Loads class indep



Currently SerializableConfigParser.Loads is a static method that returns
a SerializableConfigParser. With this patch we change it to a class
method that returns a member of the class. This way a subclass calling
Loads on itself will get its own member, rather than a bare
SerializableConfigParser.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarBalazs Lecz <leczb@google.com>
parent 71834b2a
......@@ -1034,10 +1034,10 @@ class SerializableConfigParser(ConfigParser.SafeConfigParser):
self.write(buf)
return buf.getvalue()
@staticmethod
def Loads(data):
@classmethod
def Loads(cls, data):
"""Load data from a string."""
buf = StringIO(data)
cfp = SerializableConfigParser()
cfp = cls()
cfp.readfp(buf)
return cfp
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment