diff options
author | Fred Drake <fdrake@acm.org> | 2000-08-17 04:45:13 +0000 |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-08-17 04:45:13 +0000 |
commit | dd72b25269d8148beb026275d0d68fb816db1cb1 (patch) | |
tree | 912efc01bc2e7b7e9cb6c316cf9dca073aa56dba | |
parent | 09faffea7eb817616eadeaf64309ca6dbeac4599 (diff) | |
download | cpython-dd72b25269d8148beb026275d0d68fb816db1cb1.tar.gz |
Convert some old-style string exceptions to class exceptions.
-rw-r--r-- | Lib/sunau.py | 3 | ||||
-rw-r--r-- | Lib/sunaudio.py | 3 | ||||
-rw-r--r-- | Lib/toaiff.py | 3 | ||||
-rw-r--r-- | Lib/tokenize.py | 5 | ||||
-rwxr-xr-x | Lib/uu.py | 3 | ||||
-rw-r--r-- | Lib/wave.py | 3 |
6 files changed, 14 insertions, 6 deletions
diff --git a/Lib/sunau.py b/Lib/sunau.py index 940cfd47fe..5ece29534e 100644 --- a/Lib/sunau.py +++ b/Lib/sunau.py @@ -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 diff --git a/Lib/sunaudio.py b/Lib/sunaudio.py index b7df71c97e..cbd17d26d4 100644 --- a/Lib/sunaudio.py +++ b/Lib/sunaudio.py @@ -2,7 +2,8 @@ MAGIC = '.snd' -error = 'sunaudio sound header conversion error' +class error(Exception): + pass def get_long_be(s): diff --git a/Lib/toaiff.py b/Lib/toaiff.py index 84a77863a1..52c5a89aaf 100644 --- a/Lib/toaiff.py +++ b/Lib/toaiff.py @@ -53,7 +53,8 @@ uncompress = pipes.Template() uncompress.append('uncompress', '--') -error = 'toaiff.error' # Exception +class error(Exception): + pass def toaiff(filename): temps = [] diff --git a/Lib/tokenize.py b/Lib/tokenize.py index 1383f21246..a225211a74 100644 --- a/Lib/tokenize.py +++ b/Lib/tokenize.py @@ -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)) @@ -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""" diff --git a/Lib/wave.py b/Lib/wave.py index 60c0b98319..c8cf997eca 100644 --- a/Lib/wave.py +++ b/Lib/wave.py @@ -73,7 +73,8 @@ is destroyed. import __builtin__ -Error = 'wave.Error' +class Error(Exception): + pass WAVE_FORMAT_PCM = 0x0001 |