Kaydet (Commit) 9b8d801c authored tarafından Fred Drake's avatar Fred Drake

Convert some old-style string exceptions to class exceptions.

üst de9fec5f
...@@ -128,7 +128,8 @@ _simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8, ...@@ -128,7 +128,8 @@ _simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8,
AUDIO_FILE_ENCODING_LINEAR_32, AUDIO_FILE_ENCODING_LINEAR_32,
AUDIO_FILE_ENCODING_ALAW_8] AUDIO_FILE_ENCODING_ALAW_8]
Error = 'sunau.Error' class Error(Exception):
pass
def _read_u32(file): def _read_u32(file):
x = 0L x = 0L
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
MAGIC = '.snd' MAGIC = '.snd'
error = 'sunaudio sound header conversion error' class error(Exception):
pass
def get_long_be(s): def get_long_be(s):
......
...@@ -53,7 +53,8 @@ uncompress = pipes.Template() ...@@ -53,7 +53,8 @@ uncompress = pipes.Template()
uncompress.append('uncompress', '--') uncompress.append('uncompress', '--')
error = 'toaiff.error' # Exception class error(Exception):
pass
def toaiff(filename): def toaiff(filename):
temps = [] temps = []
......
...@@ -76,7 +76,10 @@ endprogs = {"'": re.compile(Single), '"': re.compile(Double), ...@@ -76,7 +76,10 @@ endprogs = {"'": re.compile(Single), '"': re.compile(Double),
"R'''": single3prog, 'R"""': double3prog, 'r': None, 'R': None} "R'''": single3prog, 'R"""': double3prog, 'r': None, 'R': None}
tabsize = 8 tabsize = 8
TokenError = 'TokenError'
class TokenError(Exception):
pass
def printtoken(type, token, (srow, scol), (erow, ecol), line): # for testing def printtoken(type, token, (srow, scol), (erow, ecol), line): # for testing
print "%d,%d-%d,%d:\t%s\t%s" % \ print "%d,%d-%d,%d:\t%s\t%s" % \
(srow, scol, erow, ecol, tok_name[type], repr(token)) (srow, scol, erow, ecol, tok_name[type], repr(token))
......
...@@ -35,7 +35,8 @@ import os ...@@ -35,7 +35,8 @@ import os
import string import string
import sys import sys
Error = 'uu.Error' class Error(Exception):
pass
def encode(in_file, out_file, name=None, mode=None): def encode(in_file, out_file, name=None, mode=None):
"""Uuencode file""" """Uuencode file"""
......
...@@ -73,7 +73,8 @@ is destroyed. ...@@ -73,7 +73,8 @@ is destroyed.
import __builtin__ import __builtin__
Error = 'wave.Error' class Error(Exception):
pass
WAVE_FORMAT_PCM = 0x0001 WAVE_FORMAT_PCM = 0x0001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment