# HG changeset patch # User Stefan Monnier # Date 1156089170 0 # Node ID 044730770048efa663d6b20bbc93aeb8c6a8c9b4 # Parent 94094ff1136482b788b891afc4d2da14e46143eb (eexecfile): Use the __main__ rather than `emacs' namespace. diff -r 94094ff11364 -r 044730770048 etc/ChangeLog --- a/etc/ChangeLog Sun Aug 20 14:43:29 2006 +0000 +++ b/etc/ChangeLog Sun Aug 20 15:52:50 2006 +0000 @@ -1,3 +1,7 @@ +2006-08-20 Stefan Monnier + + * emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace. + 2006-08-18 Primoz PETERLIN * TUTORIAL.sl: Synchronize with TUTORIAL. diff -r 94094ff11364 -r 044730770048 etc/emacs.py --- a/etc/emacs.py Sun Aug 20 14:43:29 2006 +0000 +++ b/etc/emacs.py Sun Aug 20 15:52:50 2006 +0000 @@ -26,13 +26,14 @@ def eexecfile (file): """Execute FILE and then remove it. + Execute the file within the __main__ namespace. If we get an exception, print a traceback with the top frame - (oursleves) excluded.""" + (ourselves) excluded.""" try: - try: execfile (file, globals (), globals ()) - except: - (type, value, tb) = sys.exc_info () - # Lose the stack frame for this location. + try: execfile (file, __main__.__dict__) + except: + (type, value, tb) = sys.exc_info () + # Lose the stack frame for this location. tb = tb.tb_next if tb is None: # print_exception won't do it print "Traceback (most recent call last):"