I assume you are referring to this post. It should work but make sure you are using the right path to the Python 3.1 you installed. Check with:
$ which python3
/usr/local/bin/python3
If you used the python.org 3.1 installer, it should be available at /usr/local/bin/python3
. Other methods may vary, for instance, the MacPorts python3.1 would normally be at /opt/local/bin/python3
.
UPDATE: Since you indicate that it still doesn't work for you, my guess is that we are using different versions of TextMate's Python bundle. Using the TextMate Bundle Editor (menu item Bundles -> Bundle Editor -> Show Bundle Editor
) then selecting the Python bundle's Run Script
command, I see the following command snippet:
#!/usr/bin/env ruby
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"
TextMate.save_current_document
TextMate::Executor.make_project_master_current_document
ENV["PYTHONPATH"] = ENV["TM_BUNDLE_SUPPORT"] + (ENV.has_key?("PYTHONPATH") ? ":" + ENV["PYTHONPATH"] : "")
is_test_script = ENV["TM_FILEPATH"] =~ /(?:\b|_)(?:test)(?:\b|_)/ or
File.read(ENV["TM_FILEPATH"]) =~ /\bimport\b.+(?:unittest)/
TextMate::Executor.run(ENV["TM_PYTHON"] || "python", "-u", ENV["TM_FILEPATH"]) do |str, type|
if is_test_script and type == :err
if str =~ /\A[\.F]*\Z/
str.gsub!(/(\.|F)/, "<span class=\"test ok\">\\1</span>")
str + "<br/>\n"
elsif str =~ /\A(FAILED.*)\Z/
"<div class=\"test fail\">#{htmlize $1}</div>\n"
elsif str =~ /\A(OK.*)\Z/
"<div class=\"test ok\">#{htmlize $1}</div>\n"
elsif str =~ /^(\s+)File "(.+)", line (\d+), in (.*)/
indent = $1
file = $2
line = $3
method = $4
indent += " " if file.sub!(/^\"(.*)\"/,"\1")
url = "&url=file://" + e_url(file)
display_name = ENV["TM_DISPLAYNAME"]
"#{htmlize(indent)}<a class=\"near\" href=\"txmt://open?line=#{line + url}\">" +
(method ? "method #{CGI::escapeHTML method}" : "<em>at top level</em>") +
"</a> in <strong>#{CGI::escapeHTML display_name}</strong> at line #{line}<br/>\n"
end
end
end
Check and see if you have the same. If not, you should consider updating TextMate and/or the bundle. The GetBundle
bundle makes it easy to keep bundles up-to-date as described here.