diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-08-20 15:53:57 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2006-08-20 15:53:57 +0000 |
commit | c7bb83bdeb37144192a4924535a11daa8d57535a (patch) | |
tree | 270de0f3096fba0ddcc6d4a8709978aa8e4fe3d4 /etc/emacs.py | |
parent | f9ac92c539946ca1f4dc77e044dd05708c71e03d (diff) | |
download | emacs-c7bb83bdeb37144192a4924535a11daa8d57535a.tar.gz |
(eexecfile): Use the __main__ rather than `emacs' namespace.
Diffstat (limited to 'etc/emacs.py')
-rw-r--r-- | etc/emacs.py | 11 |
1 files changed, 6 insertions, 5 deletions
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):" |