summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2009-09-12 17:16:22 +0200
committerMartin v. Löwis <martin@v.loewis.de>2009-09-12 17:16:22 +0200
commit63ad9ff720754e36a2b0299f2c857228f32b0c52 (patch)
tree30853c4678acfd2212419b633c4830ee4424826c
parenta3efc4cae6bfa2e8a03a7b75380f29c660b876cb (diff)
downloadpython-setuptools-git-63ad9ff720754e36a2b0299f2c857228f32b0c52.tar.gz
Implement isascii.
--HG-- branch : distribute extra : rebase_source : 6805617a1673859320ae278cfbb6f7136d20a0a8
-rw-r--r--distribute.egg-info/entry_points.txt2
-rwxr-xr-xsetuptools/command/easy_install.py14
2 files changed, 14 insertions, 2 deletions
diff --git a/distribute.egg-info/entry_points.txt b/distribute.egg-info/entry_points.txt
index 49763a63..c625317e 100644
--- a/distribute.egg-info/entry_points.txt
+++ b/distribute.egg-info/entry_points.txt
@@ -32,7 +32,7 @@ depends.txt = setuptools.command.egg_info:warn_depends_obsolete
[console_scripts]
easy_install = setuptools.command.easy_install:main
-easy_install-2.6 = setuptools.command.easy_install:main
+easy_install-3.1 = setuptools.command.easy_install:main
[setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 7ed467f0..9e1f8711 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -42,9 +42,21 @@ def samefile(p1,p2):
if sys.version_info <= (3,):
def _to_ascii(s):
return s
+ def isascii(s):
+ try:
+ unicode(s, 'ascii')
+ return True
+ except UnicodeError:
+ return False
else:
def _to_ascii(s):
return s.encode('ascii')
+ def isascii(s):
+ try:
+ s.encode('ascii')
+ return True
+ except UnicodeError:
+ return False
class easy_install(Command):
"""Manage a download/build/install process"""
@@ -1439,7 +1451,7 @@ def get_script_header(script_text, executable=sys_executable, wininst=False):
else:
executable = nt_quote_arg(executable)
hdr = "#!%(executable)s%(options)s\n" % locals()
- if unicode(hdr,'ascii','ignore').encode('ascii') != hdr:
+ if not isascii(hdr):
# Non-ascii path to sys.executable, use -x to prevent warnings
if options:
if options.strip().startswith('-'):