From 299a9d2f356de19fc6df0952655c79817aa2c1b1 Mon Sep 17 00:00:00 2001 From: tarek Date: Fri, 11 Sep 2009 18:29:31 +0200 Subject: better marker for easy_install detection --HG-- branch : distribute extra : rebase_source : 2119ce08a6104dd1269137a28044684db358d402 --- setup.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 9ef640de..da9b519a 100755 --- a/setup.py +++ b/setup.py @@ -16,12 +16,13 @@ scripts = [] # if we are installing Distribute using "python setup.py install" # we need to get setuptools out of the way +def _easy_install_marker(): + return (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and + sys.argv[3] == '--dist-dir' and 'egg-dist-tmp-' in sys.argv[-1]) + def _being_installed(): # easy_install marker - if (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and - sys.argv[3] == '--dist-dir'): - return True - return 'install' in sys.argv[1:] + return 'install' in sys.argv[1:] or _easy_install_marker() if _being_installed(): from distribute_setup import before_install -- cgit v1.2.1