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
commit9ce23844a186bb77a922e3240311e611c1fd1927 (patch)
tree657f23715b7a10756283fab03a2cd93af70f9e21 /Lib/xdrlib.py
parent26261c759cc8f7775561c6e9eb69accf0c7a1930 (diff)
downloadcpython-9ce23844a186bb77a922e3240311e611c1fd1927.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