svn diff trace.py Index: trace.py =================================================================== --- trace.py (revision 54281) +++ trace.py (working copy) @@ -776,6 +776,9 @@ countcallers=countcallers, ignoremods=ignore_modules, ignoredirs=ignore_dirs, infile=counts_file, outfile=counts_file) + + global __file__ + __file__ = progname try: t.run('execfile(%r)' % (progname,)) except IOError, err: