]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Drop support for Python 2.4 in upload command.
authorJason R. Coombs <jaraco@jaraco.com>
Sat, 10 May 2014 17:22:43 +0000 (13:22 -0400)
committerJason R. Coombs <jaraco@jaraco.com>
Sat, 10 May 2014 17:22:43 +0000 (13:22 -0400)
Lib/distutils/command/upload.py

index 782446660583d3249c973f0c7ec1f9b915045b24..75498b14d57c538eb14318ff609768e2efa4e01e 100644 (file)
@@ -5,10 +5,10 @@ Implements the Distutils 'upload' subcommand (upload package to a package
 index).
 """
 
-import sys
 import os
 import io
 import platform
+import hashlib
 from base64 import standard_b64encode
 from urllib.request import urlopen, Request, HTTPError
 from urllib.parse import urlparse
@@ -17,12 +17,6 @@ from distutils.core import PyPIRCCommand
 from distutils.spawn import spawn
 from distutils import log
 
-# 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"
@@ -106,7 +100,7 @@ class upload(PyPIRCCommand):
             'content': (os.path.basename(filename),content),
             'filetype': command,
             'pyversion': pyversion,
-            'md5_digest': md5(content).hexdigest(),
+            'md5_digest': hashlib.md5(content).hexdigest(),
 
             # additional meta-data
             'metadata_version': '1.0',