diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-12 00:43:29 (GMT) |
commit | 016880229a369a3fb419f3eed28b6db7c342fe71 (patch) | |
tree | 9b11de5c197bc556dd515e035327673765cd4871 /Lib/lib-tk/Tkinter.py | |
parent | 41eaedd3613cebc83e6b9925499369992c7a7770 (diff) | |
download | cpython-016880229a369a3fb419f3eed28b6db7c342fe71.zip cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.gz cpython-016880229a369a3fb419f3eed28b6db7c342fe71.tar.bz2 |
Kill execfile(), use exec() instead
Diffstat (limited to 'Lib/lib-tk/Tkinter.py')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index ef588e8..144be0a 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1688,8 +1688,8 @@ class Tk(Misc, Wm): _default_root = None def readprofile(self, baseName, className): """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into - the Tcl Interpreter and calls execfile on BASENAME.py and CLASSNAME.py if - such a file exists in the home directory.""" + the Tcl Interpreter and calls exec on the contents of BASENAME.py and + CLASSNAME.py if such a file exists in the home directory.""" import os if 'HOME' in os.environ: home = os.environ['HOME'] else: home = os.curdir @@ -1702,11 +1702,11 @@ class Tk(Misc, Wm): if os.path.isfile(class_tcl): self.tk.call('source', class_tcl) if os.path.isfile(class_py): - execfile(class_py, dir) + exec(open(class_py).read(), dir) if os.path.isfile(base_tcl): self.tk.call('source', base_tcl) if os.path.isfile(base_py): - execfile(base_py, dir) + exec(open(base_py).read(), dir) def report_callback_exception(self, exc, val, tb): """Internal function. It reports exception on sys.stderr.""" import traceback, sys |