summaryrefslogtreecommitdiff
path: root/Lib/xdrlib.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-30 01:19:48 +0000
committerCollin Winter <collinw@gmail.com>2007-08-30 01:19:48 +0000
commitce36ad8a467d914eb5c91f33835b9eaea18ee93b (patch)
tree05bf654f3359e20b455dc300bd860bba5d291c8d /Lib/xdrlib.py
parent8b3febef2f96c35e9aad9db2ef499db040fdefae (diff)
downloadcpython-git-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.gz
Raise statement normalization in Lib/.
Diffstat (limited to 'Lib/xdrlib.py')
-rw-r--r--Lib/xdrlib.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py
index 98bdedb67d..b293e06a10 100644
--- a/Lib/xdrlib.py
+++ b/Lib/xdrlib.py
@@ -66,16 +66,16 @@ class Packer:
def pack_float(self, x):
try: self.__buf.write(struct.pack('>f', x))
except struct.error as msg:
- raise ConversionError, msg
+ raise ConversionError(msg)
def pack_double(self, x):
try: self.__buf.write(struct.pack('>d', x))
except struct.error as msg:
- raise ConversionError, msg
+ raise ConversionError(msg)
def pack_fstring(self, n, s):
if n < 0:
- raise ValueError, 'fstring size must be nonnegative'
+ raise ValueError('fstring size must be nonnegative')
data = s[:n]
n = ((n+3)//4)*4
data = data + (n - len(data)) * b'\0'
@@ -99,7 +99,7 @@ class Packer:
def pack_farray(self, n, list, pack_item):
if len(list) != n:
- raise ValueError, 'wrong array size'
+ raise ValueError('wrong array size')
for item in list:
pack_item(item)
@@ -187,7 +187,7 @@ class Unpacker:
def unpack_fstring(self, n):
if n < 0:
- raise ValueError, 'fstring size must be nonnegative'
+ raise ValueError('fstring size must be nonnegative')
i = self.__pos
j = i + (n+3)//4*4
if j > len(self.__buf):
@@ -210,7 +210,7 @@ class Unpacker:
x = self.unpack_uint()
if x == 0: break
if x != 1:
- raise ConversionError, '0 or 1 expected, got %r' % (x,)
+ raise ConversionError('0 or 1 expected, got %r' % (x,))
item = unpack_item()
list.append(item)
return list