mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
(eexecfile): Use the __main__ rather than `emacs' namespace.
This commit is contained in:
parent
f9ac92c539
commit
c7bb83bdeb
2 changed files with 10 additions and 5 deletions
|
|
@ -1,3 +1,7 @@
|
|||
2006-08-20 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change)
|
||||
|
||||
* emacs.py (eexecfile): Use the __main__ rather than `emacs' namespace.
|
||||
|
||||
2006-08-18 Primoz PETERLIN <primoz.peterlin@mf.uni-lj.si>
|
||||
|
||||
* TUTORIAL.sl: Synchronize with TUTORIAL.
|
||||
|
|
|
|||
11
etc/emacs.py
11
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):"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue