From: Stefan Monnier Date: Sun, 20 Aug 2006 15:53:57 +0000 (+0000) Subject: (eexecfile): Use the __main__ rather than `emacs' namespace. X-Git-Tag: emacs-pretest-22.0.90~944 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c7bb83bdeb37144192a4924535a11daa8d57535a;p=emacs.git (eexecfile): Use the __main__ rather than `emacs' namespace. --- diff --git a/etc/ChangeLog b/etc/ChangeLog index 0d61048a858..ec2b017c25c 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2006-08-20 Slawomir Nowaczyk (tiny change) + + * emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace. + 2006-08-18 Primoz PETERLIN * TUTORIAL.sl: Synchronize with TUTORIAL. diff --git a/etc/emacs.py b/etc/emacs.py index 9538b0b7127..bc6c5bb034d 100644 --- a/etc/emacs.py +++ b/etc/emacs.py @@ -26,13 +26,14 @@ __all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] 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):"