diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py
index 4e98c4c8026..4221bcc9413 100644
--- a/Lib/xmlrpclib.py
+++ b/Lib/xmlrpclib.py
@@ -33,6 +33,7 @@
# 2001-09-10 fl Lazy import of urllib, cgi, xmllib (20x import speedup)
# 2001-10-01 fl Remove containers from memo cache when done with them
# 2001-10-01 fl Use faster escape method (80% dumps speedup)
+# 2001-10-10 sm Allow long ints to be passed as ints if they don't overflow
#
# Copyright (c) 1999-2001 by Secret Labs AB.
# Copyright (c) 1999-2001 by Fredrik Lundh.
@@ -464,6 +465,11 @@ def dump_int(self, value):
self.write("%s\n" % value)
dispatch[IntType] = dump_int
+ def dump_long(self, value):
+ val = int(value)
+ self.write("%s\n" % val)
+ dispatch[LongType] = dump_long
+
def dump_double(self, value):
self.write("%s\n" % value)
dispatch[FloatType] = dump_double