diff options
author | pje <pje@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2005-05-29 06:41:14 +0000 |
---|---|---|
committer | pje <pje@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2005-05-29 06:41:14 +0000 |
commit | 0767aa6560c9c99db95fe98db54ed94b58ae2dbe (patch) | |
tree | d5d769be1ba717207f8c6518a0e7e92f154cfe9e /easy_install.py | |
parent | bd9488199abb94d0ecf45aa6e4d17e6351ff7d51 (diff) | |
download | python-setuptools-0767aa6560c9c99db95fe98db54ed94b58ae2dbe.tar.gz |
Oddly enough, some setup.py files actually check __name__=='__main__'
git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@41022 6015fed2-1504-0410-9fe1-9d1591cc4771
Diffstat (limited to 'easy_install.py')
-rwxr-xr-x | easy_install.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/easy_install.py b/easy_install.py index 0ca094b..36482fe 100755 --- a/easy_install.py +++ b/easy_install.py @@ -184,7 +184,7 @@ class Installer: ) elif multi is None: multi = True - + elif not multi: # explicit false, raise an error raise RuntimeError( @@ -337,7 +337,9 @@ class Installer: try: sys.argv[:] = [setup_script, '-q', 'bdist_egg'] sys.path.insert(0,os.getcwd()) - execfile(setup_script, {'__file__':setup_script}) + execfile(setup_script, + {'__file__':setup_script, '__name__':'__main__'} + ) except SystemExit, v: if v.args and v.args[0]: raise RuntimeError( @@ -365,8 +367,6 @@ class Installer: - - def install_egg(self, egg_path, zip_ok): import shutil destination = os.path.join(self.instdir, os.path.basename(egg_path)) @@ -383,10 +383,10 @@ class Installer: shutil.move(egg_path, destination) else: shutil.copy2(egg_path, destination) - + elif os.path.isdir(egg_path): shutil.move(egg_path, destination) - + else: os.mkdir(destination) self._extract_zip(egg_path, destination) @@ -502,7 +502,7 @@ def main(argv): parser.add_option("-z", "--zip", action="store_true", dest="zip_ok", default=False, help="install package as a zipfile") - + parser.add_option("-m", "--multi-version", action="store_true", dest="multi", default=None, help="make apps have to require() a version") @@ -512,7 +512,7 @@ def main(argv): try: if not args: raise RuntimeError("No urls, filenames, or requirements specified") - + for spec in args: inst = Installer(options.instdir, options.zip_ok, options.multi) try: |