[pypy-commit] pypy default: Allows presetup.py to execute setup.py scripts which use

amauryfa noreply at buildbot.pypy.org
Wed Nov 16 01:03:23 CET 2011


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r49457:dff1cac01f75
Date: 2011-11-16 01:01 +0100
http://bitbucket.org/pypy/pypy/changeset/dff1cac01f75/

Log:	Allows presetup.py to execute setup.py scripts which use the "if
	__name__ == '__main__'" idiom

diff --git a/pypy/module/cpyext/presetup.py b/pypy/module/cpyext/presetup.py
--- a/pypy/module/cpyext/presetup.py
+++ b/pypy/module/cpyext/presetup.py
@@ -42,4 +42,4 @@
 patch_distutils()
 
 del sys.argv[0]
-execfile(sys.argv[0], {'__file__': sys.argv[0]})
+execfile(sys.argv[0], {'__file__': sys.argv[0], '__name__': '__main__'})


More information about the pypy-commit mailing list