diff -r b6059bac8a9c Lib/distutils/core.py --- a/Lib/distutils/core.py Fri Sep 06 15:41:30 2013 -0500 +++ b/Lib/distutils/core.py Sat Sep 07 11:53:21 2013 +0200 @@ -207,15 +207,14 @@ _setup_stop_after = stop_after save_argv = sys.argv - g = {'__file__': script_name} - l = {} + g = {'__file__': script_name, '__name__': '__main__'} try: try: sys.argv[0] = script_name if script_args is not None: sys.argv[1:] = script_args with open(script_name, 'rb') as f: - exec(f.read(), g, l) + exec(f.read(), g) finally: sys.argv = save_argv _setup_stop_after = None @@ -231,7 +230,7 @@ "perhaps '%s' is not a Distutils setup script?") % \ script_name) - # I wonder if the setup script's namespace -- g and l -- would be of + # I wonder if the setup script's namespace -- g -- would be of # any interest to callers? #print "_setup_distribution:", _setup_distribution return _setup_distribution