From: Fred Drake Date: Fri, 18 Aug 2000 14:59:33 +0000 (+0000) Subject: Convert some old-style string exceptions to class exceptions. X-Git-Tag: v2.0b1~369 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=def003845b687b785f70d655a5372906f7e042d2;p=thirdparty%2FPython%2Fcpython.git Convert some old-style string exceptions to class exceptions. --- diff --git a/Lib/plat-irix5/flp.py b/Lib/plat-irix5/flp.py index 9f1957f93e68..6c6dae513812 100755 --- a/Lib/plat-irix5/flp.py +++ b/Lib/plat-irix5/flp.py @@ -12,7 +12,8 @@ SPLITLINE = '--------------------' FORMLINE = '=============== FORM ===============' ENDLINE = '==============================' -error = 'flp.error' +class error(Exception): + pass ################################################################## # Part 1 - The parsing routines # diff --git a/Lib/plat-irix5/jpeg.py b/Lib/plat-irix5/jpeg.py index 2e7ced56bfee..298ebb5f79ef 100755 --- a/Lib/plat-irix5/jpeg.py +++ b/Lib/plat-irix5/jpeg.py @@ -5,7 +5,8 @@ # XXX It appears that compressing grayscale images doesn't work right; # XXX the resulting file causes weirdness. -error = 'jpeg.error' # Exception +class error(Exception): + pass options = {'quality': 75, 'optimize': 0, 'smooth': 0, 'forcegray': 0} diff --git a/Lib/plat-irix5/readcd.py b/Lib/plat-irix5/readcd.py index 5c4b824250bd..403353fdac43 100755 --- a/Lib/plat-irix5/readcd.py +++ b/Lib/plat-irix5/readcd.py @@ -2,8 +2,10 @@ import cd, CD -Error = 'Readcd.Error' -_Stop = 'Readcd.Stop' +class Error(Exception): + pass +class _Stop(Exception): + pass def _doatime(self, cb_type, data): if ((data[0] * 60) + data[1]) * 75 + data[2] > self.end: diff --git a/Lib/plat-irix5/torgb.py b/Lib/plat-irix5/torgb.py index f283063c000c..59e3fbefba3a 100755 --- a/Lib/plat-irix5/torgb.py +++ b/Lib/plat-irix5/torgb.py @@ -50,7 +50,8 @@ uncompress = pipes.Template() uncompress.append('uncompress', '--') -error = 'torgb.error' # Exception +class error(Exception): + pass def torgb(filename): temps = [] diff --git a/Lib/plat-irix6/flp.py b/Lib/plat-irix6/flp.py index 9f1957f93e68..6c6dae513812 100644 --- a/Lib/plat-irix6/flp.py +++ b/Lib/plat-irix6/flp.py @@ -12,7 +12,8 @@ SPLITLINE = '--------------------' FORMLINE = '=============== FORM ===============' ENDLINE = '==============================' -error = 'flp.error' +class error(Exception): + pass ################################################################## # Part 1 - The parsing routines # diff --git a/Lib/plat-irix6/jpeg.py b/Lib/plat-irix6/jpeg.py index c1ed669f97c5..1af6a013dda1 100644 --- a/Lib/plat-irix6/jpeg.py +++ b/Lib/plat-irix6/jpeg.py @@ -5,7 +5,8 @@ # XXX It appears that compressing grayscale images doesn't work right; # XXX the resulting file causes weirdness. -error = 'jpeg.error' # Exception +class error(Exception): + pass options = {'quality': 75, 'optimize': 0, 'smooth': 0, 'forcegray': 0} diff --git a/Lib/plat-irix6/readcd.py b/Lib/plat-irix6/readcd.py index 5c4b824250bd..403353fdac43 100644 --- a/Lib/plat-irix6/readcd.py +++ b/Lib/plat-irix6/readcd.py @@ -2,8 +2,10 @@ import cd, CD -Error = 'Readcd.Error' -_Stop = 'Readcd.Stop' +class Error(Exception): + pass +class _Stop(Exception): + pass def _doatime(self, cb_type, data): if ((data[0] * 60) + data[1]) * 75 + data[2] > self.end: diff --git a/Lib/plat-irix6/torgb.py b/Lib/plat-irix6/torgb.py index f283063c000c..59e3fbefba3a 100644 --- a/Lib/plat-irix6/torgb.py +++ b/Lib/plat-irix6/torgb.py @@ -50,7 +50,8 @@ uncompress = pipes.Template() uncompress.append('uncompress', '--') -error = 'torgb.error' # Exception +class error(Exception): + pass def torgb(filename): temps = []