[PATCH] Don't raise text exceptions



Use the Exception("MESSAGE GOES HERE") constructor instead

-- 
Vincent Legoll
Index: diffutil.py
===================================================================
--- diffutil.py	(révision 1157)
+++ diffutil.py	(copie de travail)
@@ -89,7 +89,7 @@
             seq1 = IncrementalSequenceMatcher(None, sequences[1], sequences[2]).get_difference_opcodes()
             self.diffs = seq0, seq1
         else:
-            raise "Bad number of arguments to Differ constructor (%i)" % len(sequences)
+            raise Exception("Bad number of arguments to Differ constructor (%i)" % len(sequences))
 
     def change_sequence(self, sequence, startidx, sizechange, texts):
         assert sequence in (0,1,2)
@@ -296,7 +296,7 @@
                     yield None
                 diffs[i] = matcher.get_difference_opcodes()
         else:
-            raise "Bad number of arguments to Differ constructor (%i)" % len(sequences)
+            raise Exception("Bad number of arguments to Differ constructor (%i)" % len(sequences))
         self.diffs = diffs
         self.num_sequences = len(sequences)
         self.seqlength = [0,0,0]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]