mirror of https://github.com/python/cpython
Merged revisions 73435 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r73435 | tarek.ziade | 2009-06-16 01:04:29 +0200 (Tue, 16 Jun 2009) | 1 line code cleanup ........
This commit is contained in:
parent
5a55b61a2a
commit
6f6f9462b0
|
@ -1,11 +1,6 @@
|
|||
"""distutils.command.upload
|
||||
|
||||
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
|
||||
|
||||
from distutils.errors import *
|
||||
from distutils.core import PyPIRCCommand
|
||||
from distutils.spawn import spawn
|
||||
from distutils import log
|
||||
import sys
|
||||
import os, io
|
||||
import socket
|
||||
|
@ -14,13 +9,13 @@ import configparser
|
|||
import http.client as httpclient
|
||||
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
|
||||
|
||||
from distutils.errors import *
|
||||
from distutils.core import PyPIRCCommand
|
||||
from distutils.spawn import spawn
|
||||
from distutils import log
|
||||
|
||||
class upload(PyPIRCCommand):
|
||||
|
||||
description = "upload binary package to PyPI"
|
||||
|
@ -137,10 +132,10 @@ class upload(PyPIRCCommand):
|
|||
for key, value in data.items():
|
||||
title = '\nContent-Disposition: form-data; name="%s"' % key
|
||||
# handle multiple entries for the same name
|
||||
if type(value) != type([]):
|
||||
if not isinstance(value, list):
|
||||
value = [value]
|
||||
for value in value:
|
||||
if type(value) is tuple:
|
||||
if isinstance(value, tuple):
|
||||
title += '; filename="%s"' % value[0]
|
||||
value = value[1]
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue