]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Convert some old-style string exceptions to class exceptions.
authorFred Drake <fdrake@acm.org>
Thu, 17 Aug 2000 04:45:13 +0000 (04:45 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 17 Aug 2000 04:45:13 +0000 (04:45 +0000)
Lib/sunau.py
Lib/sunaudio.py
Lib/toaiff.py
Lib/tokenize.py
Lib/uu.py
Lib/wave.py

index 940cfd47fe1cf9491cd8930368bba87fc300c3a6..5ece29534eba39b67d03166b4e70b52f6f9e31b9 100644 (file)
@@ -128,7 +128,8 @@ _simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8,
                     AUDIO_FILE_ENCODING_LINEAR_32,
                     AUDIO_FILE_ENCODING_ALAW_8]
 
-Error = 'sunau.Error'
+class Error(Exception):
+       pass
 
 def _read_u32(file):
        x = 0L
index b7df71c97efc996db86fbb2753f6ed41000bcf4e..cbd17d26d48bb0c50259f784bbe2bd7dbdd18ed2 100644 (file)
@@ -2,7 +2,8 @@
 
 MAGIC = '.snd'
 
-error = 'sunaudio sound header conversion error'
+class error(Exception):
+       pass
 
 
 def get_long_be(s):
index 84a77863a1720ddf4288b150f8a45db19658a416..52c5a89aafee3e707098d8a0c01c969374e89e92 100644 (file)
@@ -53,7 +53,8 @@ uncompress = pipes.Template()
 uncompress.append('uncompress', '--')
 
 
-error = 'toaiff.error' # Exception
+class error(Exception):
+        pass
 
 def toaiff(filename):
        temps = []
index 1383f2124663607669e95c248a8ce0617608580f..a225211a74cadd21cab1db1a3e0c653b5e114429 100644 (file)
@@ -76,7 +76,10 @@ endprogs = {"'": re.compile(Single), '"': re.compile(Double),
             "R'''": single3prog, 'R"""': double3prog, 'r': None, 'R': None}
 
 tabsize = 8
-TokenError = 'TokenError'
+
+class TokenError(Exception):
+    pass
+
 def printtoken(type, token, (srow, scol), (erow, ecol), line): # for testing
     print "%d,%d-%d,%d:\t%s\t%s" % \
         (srow, scol, erow, ecol, tok_name[type], repr(token))
index 252576d88137f1f80e8abcb9c62fefaa92af89cc..e39b61bff341ef9a97f402770818652fe410bff4 100755 (executable)
--- a/Lib/uu.py
+++ b/Lib/uu.py
@@ -35,7 +35,8 @@ import os
 import string
 import sys
 
-Error = 'uu.Error'
+class Error(Exception):
+    pass
 
 def encode(in_file, out_file, name=None, mode=None):
     """Uuencode file"""
index 60c0b98319ffe0fb0dde4a8b935ce1cec6f6870b..c8cf997ecaa788a6a5797b5f321f09fd94f0266b 100644 (file)
@@ -73,7 +73,8 @@ is destroyed.
 
 import __builtin__
 
-Error = 'wave.Error'
+class Error(Exception):
+    pass
 
 WAVE_FORMAT_PCM = 0x0001