summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-06-28 21:10:49 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-06-28 21:10:49 (GMT)
commit6f6f9462b06374a9adf84c62e1a40e917df2d6dd (patch)
treef56a3a8d27c68fce34e4a6babd5711d891ad1bf3 /Lib/distutils
parent5a55b61a2aa15b94d26bbc058ee2b5433178a42e (diff)
downloadcpython-6f6f9462b06374a9adf84c62e1a40e917df2d6dd.zip
cpython-6f6f9462b06374a9adf84c62e1a40e917df2d6dd.tar.gz
cpython-6f6f9462b06374a9adf84c62e1a40e917df2d6dd.tar.bz2
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 ........
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/command/upload.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/Lib/distutils/command/upload.py b/Lib/distutils/command/upload.py
index 3b4a036..2692377 100644
--- a/Lib/distutils/command/upload.py
+++ b/Lib/distutils/command/upload.py
@@ -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,12 +9,12 @@ import configparser
import http.client as httpclient
import base64
import urllib.parse
+from hashlib import md5
-# 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):
@@ -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: