Merged revisions 70017 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70017 | tarek.ziade | 2009-02-27 13:53:34 +0100 (Fri, 27 Feb 2009) | 1 line

  Issue #5052: make Distutils compatible with 2.3 again.
........
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index 020e860..eb2f516 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -6,7 +6,7 @@
 from distutils.core import PyPIRCCommand
 from distutils.spawn import spawn
 from distutils import log
-from hashlib import md5
+import sys
 import os, io
 import socket
 import platform
@@ -15,6 +15,12 @@
 import base64
 import urllib.parse
 
+# this keeps compatibility for 2.3 and 2.4
+if sys.version < "2.5":
+    from md5 import md5
+else:
+    from hashlib import md5
+
 class upload(PyPIRCCommand):
 
     description = "upload binary package to PyPI"