Some Py3 fixes for PyCrust

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@76040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-03-02 07:48:20 +00:00
parent 55c21ec895
commit 801682c786
16 changed files with 51 additions and 41 deletions

View File

@@ -816,10 +816,8 @@ def myExecfile(filename, ns):
if sys.version_info < (3,):
execfile(filename, ns)
else:
f = open(filename, 'r')
source = f.read()
f.close()
exec(source, ns)
with open(filename, 'r') as f:
exec(f.read(), ns)
def textfile_open(filename, mode='rt'):