]> git.phdru.name Git - m_lib.git/blobdiff - m_lib/flad/flad.py
Fix string.split for Py3 compatibility
[m_lib.git] / m_lib / flad / flad.py
index 830fdfd07beae6c9b38cdafa8f2be20bcb453cca..b2446d824bfa8cdeac042995405c0e4ca6f4a159 100644 (file)
@@ -40,7 +40,7 @@ class Flad(UserList):
          if callable(self.check_record_func):
             return self.check_record_func(self, record)
          else:
-            raise TypeError, "non-callable restriction function"
+            raise TypeError("non-callable restriction function")
       else:
          return 1
 
@@ -88,7 +88,7 @@ class Flad(UserList):
       if line[-1] == '\n':
          line = line[:-1] # Chop
 
-      l = string.split(line, self.key_sep, 1) # Just split to key and reminder
+      l = line.split(self.key_sep, 1) # Just split to key and reminder
       return tuple(l)
 
 
@@ -105,7 +105,7 @@ class Flad(UserList):
                                   # so it is not ready to be checked :(
                                   # And, of course, two keys with the same name
                                   # cannot be added to dictionary
-            raise KeyError, "field key \"" + key + "\" already in record"
+            raise KeyError("field key \"" + key + "\" already in record")
 
          record[key] = value
 
@@ -216,7 +216,7 @@ class Flad(UserList):
 
       flush_record = 0 # Do not close record on 1st loop
 
-      if self.comment <> '':
+      if self.comment != '':
          outfile.write(self.comment)
 
       for record in self: