Commit a384652d authored by Jason R. Coombs's avatar Jason R. Coombs

Drop support for Python 2.4 in upload command.

parent 6f71726e
...@@ -5,10 +5,10 @@ Implements the Distutils 'upload' subcommand (upload package to a package ...@@ -5,10 +5,10 @@ Implements the Distutils 'upload' subcommand (upload package to a package
index). index).
""" """
import sys
import os import os
import io import io
import platform import platform
import hashlib
from base64 import standard_b64encode from base64 import standard_b64encode
from urllib.request import urlopen, Request, HTTPError from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlparse from urllib.parse import urlparse
...@@ -17,12 +17,6 @@ from distutils.core import PyPIRCCommand ...@@ -17,12 +17,6 @@ from distutils.core import PyPIRCCommand
from distutils.spawn import spawn from distutils.spawn import spawn
from distutils import log 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): class upload(PyPIRCCommand):
description = "upload binary package to PyPI" description = "upload binary package to PyPI"
...@@ -106,7 +100,7 @@ class upload(PyPIRCCommand): ...@@ -106,7 +100,7 @@ class upload(PyPIRCCommand):
'content': (os.path.basename(filename),content), 'content': (os.path.basename(filename),content),
'filetype': command, 'filetype': command,
'pyversion': pyversion, 'pyversion': pyversion,
'md5_digest': md5(content).hexdigest(), 'md5_digest': hashlib.md5(content).hexdigest(),
# additional meta-data # additional meta-data
'metadata_version': '1.0', 'metadata_version': '1.0',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment