summaryrefslogtreecommitdiffstats
path: root/Lib/xdrlib.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2011-10-23 20:11:00 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2011-10-23 20:11:00 (GMT)
commit2bb96f593a067dafc7f02fef659ff22994b83399 (patch)
treeb2b2acc64f5e4e6da3d98541544c72b2a439e98a /Lib/xdrlib.py
parent8d48b43ea9abe494527acea05dcd6b8d067278ea (diff)
downloadcpython-2bb96f593a067dafc7f02fef659ff22994b83399.zip
cpython-2bb96f593a067dafc7f02fef659ff22994b83399.tar.gz
cpython-2bb96f593a067dafc7f02fef659ff22994b83399.tar.bz2
Cleanup code: remove int/long idioms and simplify a while statement.
Diffstat (limited to 'Lib/xdrlib.py')
-rw-r--r--Lib/xdrlib.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py
index 4e48677..86e624f 100644
--- a/Lib/xdrlib.py
+++ b/Lib/xdrlib.py
@@ -141,11 +141,7 @@ class Unpacker:
data = self.__buf[i:j]
if len(data) < 4:
raise EOFError
- x = struct.unpack('>L', data)[0]
- try:
- return int(x)
- except OverflowError:
- return x
+ return struct.unpack('>L', data)[0]
def unpack_int(self):
i = self.__pos