aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/command/easy_install.py2
-rwxr-xr-xsetuptools/command/egg_info.py4
-rw-r--r--setuptools/command/test.py2
-rwxr-xr-xsetuptools/command/upload.py4
-rw-r--r--setuptools/command/upload_docs.py4
-rw-r--r--setuptools/extension.py2
-rwxr-xr-xsetuptools/package_index.py4
-rwxr-xr-xsetuptools/sandbox.py2
-rw-r--r--setuptools/script template (dev).py5
-rw-r--r--setuptools/tests/__init__.py2
10 files changed, 19 insertions, 12 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index cf80926c..c53ca9f2 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -285,6 +285,8 @@ class easy_install(Command):
self.script_dir = self.install_scripts
# default --record from the install command
self.set_undefined_options('install', ('record', 'record'))
+ # Should this be moved to the if statement below? It's not used
+ # elsewhere
normpath = map(normalize_path, sys.path)
self.all_site_dirs = get_site_dirs()
if self.site_dirs is not None:
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index c77bd69d..1a61dfcb 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -235,8 +235,8 @@ class egg_info(Command):
log.warn("unrecognized .svn/entries format; skipping %s", base)
dirs[:] = []
continue
-
- data = map(str.splitlines,data.split('\n\x0c\n'))
+
+ data = list(map(str.splitlines,data.split('\n\x0c\n')))
del data[0][0] # get rid of the '8' or '9' or '10'
dirurl = data[0][3]
localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0])
diff --git a/setuptools/command/test.py b/setuptools/command/test.py
index a02ac142..db2fc7b1 100644
--- a/setuptools/command/test.py
+++ b/setuptools/command/test.py
@@ -154,7 +154,7 @@ class test(Command):
for name in sys.modules:
if name.startswith(module):
del_modules.append(name)
- map(sys.modules.__delitem__, del_modules)
+ list(map(sys.modules.__delitem__, del_modules))
loader_ep = EntryPoint.parse("x="+self.test_loader)
loader_class = loader_ep.load(require=False)
diff --git a/setuptools/command/upload.py b/setuptools/command/upload.py
index 7ef0e6ec..02d955ed 100755
--- a/setuptools/command/upload.py
+++ b/setuptools/command/upload.py
@@ -11,6 +11,7 @@ try:
except ImportError:
from md5 import md5
import os
+import sys
import socket
import platform
import base64
@@ -167,7 +168,8 @@ class upload(Command):
http.putheader('Authorization', auth)
http.endheaders()
http.send(body)
- except socket.error, e:
+ except socket.error:
+ e = sys.exc_info()[1]
self.announce(str(e), log.ERROR)
return
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py
index 0a545789..e07b885d 100644
--- a/setuptools/command/upload_docs.py
+++ b/setuptools/command/upload_docs.py
@@ -23,7 +23,7 @@ try:
except ImportError:
from setuptools.command.upload import upload
-from setuptools.compat import httplib, urlparse
+from setuptools.compat import httplib, urlparse, unicode, iteritems
if sys.version_info >= (3,):
errors = 'surrogateescape'
@@ -131,7 +131,7 @@ class upload_docs(upload):
sep_boundary = b('\n--') + b(boundary)
end_boundary = sep_boundary + b('--')
body = []
- for key, values in data.iteritems():
+ for key, values in iteritems(data):
title = '\nContent-Disposition: form-data; name="%s"' % key
# handle multiple entries for the same name
if type(values) != type([]):
diff --git a/setuptools/extension.py b/setuptools/extension.py
index eb8b836c..d7892d3d 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -35,7 +35,7 @@ class Extension(_Extension):
if source.endswith('.pyx'):
source = source[:-4] + '.c'
return source
- self.sources = map(pyx_to_c, self.sources)
+ self.sources = list(map(pyx_to_c, self.sources))
class Library(Extension):
"""Just like a regular Extension, but built as a library instead"""
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 5ee6fd27..25936b91 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -177,7 +177,7 @@ def find_external_links(url, page):
for match in REL.finditer(page):
tag, rel = match.groups()
- rels = map(str.strip, rel.lower().split(','))
+ rels = set(map(str.strip, rel.lower().split(',')))
if 'homepage' in rels or 'download' in rels:
for match in HREF.finditer(tag):
yield urljoin(url, htmldecode(match.group(1)))
@@ -749,7 +749,7 @@ class PackageIndex(Environment):
scheme, netloc, path, p, q, f = urlparse(url)
if not netloc and path.startswith('//') and '/' in path[2:]:
netloc, path = path[2:].split('/',1)
- auth, host = urllib.splituser(netloc)
+ auth, host = splituser(netloc)
if auth:
if ':' in auth:
user, pw = auth.split(':',1)
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py
index 090cb34c..a5a01a46 100755
--- a/setuptools/sandbox.py
+++ b/setuptools/sandbox.py
@@ -85,7 +85,7 @@ def run_setup(setup_script, args):
# exclude any encodings modules. See #285
and not mod_name.startswith('encodings.')
]
- map(sys.modules.__delitem__, del_modules)
+ list(map(sys.modules.__delitem__, del_modules))
os.chdir(old_dir)
sys.path[:] = save_path
sys.argv[:] = save_argv
diff --git a/setuptools/script template (dev).py b/setuptools/script template (dev).py
index 6dd9dd45..901790e7 100644
--- a/setuptools/script template (dev).py
+++ b/setuptools/script template (dev).py
@@ -3,4 +3,7 @@ __requires__ = """%(spec)r"""
from pkg_resources import require; require("""%(spec)r""")
del require
__file__ = """%(dev_path)r"""
-execfile(__file__)
+try:
+ execfile(__file__)
+except NameError:
+ exec(compile(open(__file__).read(), __file__, 'exec'))
diff --git a/setuptools/tests/__init__.py b/setuptools/tests/__init__.py
index cb26a052..1cd5df2b 100644
--- a/setuptools/tests/__init__.py
+++ b/setuptools/tests/__init__.py
@@ -2,7 +2,7 @@
import sys
import os
import unittest
-import doctest
+from setuptools.tests import doctest
import distutils.core
import distutils.cmd
from distutils.errors import DistutilsOptionError, DistutilsPlatformError