summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/golly/files/golly-3.3-allow-py23-exec.patch')
-rw-r--r--app-misc/golly/files/golly-3.3-allow-py23-exec.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/app-misc/golly/files/golly-3.3-allow-py23-exec.patch b/app-misc/golly/files/golly-3.3-allow-py23-exec.patch
new file mode 100644
index 000000000000..e46b608ed6c5
--- /dev/null
+++ b/app-misc/golly/files/golly-3.3-allow-py23-exec.patch
@@ -0,0 +1,12 @@
+'execfile' is python-2-only. 'exec/open' works for both python2 and python3.
+--- a/gui-wx/wxpython.cpp
++++ b/gui-wx/wxpython.cpp
+@@ -3356,7 +3388,7 @@ void RunPythonScript(const wxString& filepath)
+ // for the global namespace so that this script cannot change the
+ // globals of a caller script (which is possible now that RunScript
+ // is re-entrant)
+- wxString command = wxT("execfile('") + fpath + wxT("',{})");
++ wxString command = wxT("exec(open('") + fpath + wxT("').read(),{})");
+ PyRun_SimpleString(command.mb_str(wxConvLocal));
+ // don't use wxConvUTF8 in above line because caller has already converted
+ // filepath to decomposed UTF8 if on a Mac